From df2f06ed99b3844d7efd6ac76fdc7a813e89595f Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 20 Sep 2024 14:05:22 +0200 Subject: [PATCH 1/2] Global styles: do not navigate twice to home screen on sidebar load --- packages/edit-site/src/components/global-styles/ui.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js index 60d7e314d7776a..0a82eec789c93c 100644 --- a/packages/edit-site/src/components/global-styles/ui.js +++ b/packages/edit-site/src/components/global-styles/ui.js @@ -280,10 +280,9 @@ function GlobalStylesEditorCanvasContainerLink() { * Exclude revisions panel from this behavior, * as it should close when the editorCanvasContainerView doesn't correspond. */ - if ( path !== '/' && ! isRevisionsOpen ) { - return; + if ( path !== '/' && isRevisionsOpen ) { + goTo( '/' ); } - goTo( '/' ); break; } }, [ editorCanvasContainerView, isRevisionsOpen, goTo ] ); From 0924465ed88d814ca6a70d758cfbf6910d85e610 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Mon, 23 Sep 2024 12:45:33 +0200 Subject: [PATCH 2/2] Remove whole default block --- .../edit-site/src/components/global-styles/ui.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js index 0a82eec789c93c..bc6906a769af48 100644 --- a/packages/edit-site/src/components/global-styles/ui.js +++ b/packages/edit-site/src/components/global-styles/ui.js @@ -272,18 +272,6 @@ function GlobalStylesEditorCanvasContainerLink() { goTo( '/' ); } break; - default: - /* - * Example: the user has navigated to "Browse styles" or elsewhere - * and changes the editorCanvasContainerView, e.g., closes the style book. - * The panel should not be affected. - * Exclude revisions panel from this behavior, - * as it should close when the editorCanvasContainerView doesn't correspond. - */ - if ( path !== '/' && isRevisionsOpen ) { - goTo( '/' ); - } - break; } }, [ editorCanvasContainerView, isRevisionsOpen, goTo ] ); }