diff --git a/packages/edit-site/src/components/global-styles/screen-revisions/index.js b/packages/edit-site/src/components/global-styles/screen-revisions/index.js
index 92d5ae7d2bb68b..8a3e84e0ee41eb 100644
--- a/packages/edit-site/src/components/global-styles/screen-revisions/index.js
+++ b/packages/edit-site/src/components/global-styles/screen-revisions/index.js
@@ -42,19 +42,11 @@ function ScreenRevisions() {
blocks: select( blockEditorStore ).getBlocks(),
};
}, [] );
-
const { revisions, isLoading, hasUnsavedChanges } =
useGlobalStylesRevisions();
+ const [ selectedRevisionId, setSelectedRevisionId ] = useState();
const [ globalStylesRevision, setGlobalStylesRevision ] =
useState( userConfig );
-
- const [ currentRevisionId, setCurrentRevisionId ] = useState(
- /*
- * We need this for the first render,
- * otherwise the unsaved changes haven't been merged into the revisions array yet.
- */
- hasUnsavedChanges ? 'unsaved' : revisions?.[ 0 ]?.id
- );
const [
isLoadingRevisionWithUnsavedChanges,
setIsLoadingRevisionWithUnsavedChanges,
@@ -89,7 +81,7 @@ function ScreenRevisions() {
settings: revision?.settings,
id: revision?.id,
} );
- setCurrentRevisionId( revision?.id );
+ setSelectedRevisionId( revision?.id );
};
const isLoadButtonEnabled =
@@ -117,7 +109,7 @@ function ScreenRevisions() {
{ isLoadButtonEnabled && (
diff --git a/packages/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js b/packages/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js
index c4d624bf1727e2..f32441f6a41b06 100644
--- a/packages/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js
+++ b/packages/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js
@@ -18,9 +18,8 @@ import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
*/
function getRevisionLabel( revision ) {
const authorDisplayName = revision?.author?.name || __( 'User' );
- const isUnsaved = 'unsaved' === revision?.id;
- if ( isUnsaved ) {
+ if ( 'unsaved' === revision?.id ) {
return sprintf(
/* translators: %(name)s author display name */
__( 'Unsaved changes by %(name)s' ),
@@ -57,45 +56,42 @@ function getRevisionLabel( revision ) {
* Returns a rendered list of revisions buttons.
*
* @typedef {Object} props
- * @property {Array