Skip to content

Commit

Permalink
When applying a revision the route should switch to the global styles…
Browse files Browse the repository at this point in the history
… panel. At the moment, it's using `goBack` which means the behaviour is inconsistent depending on the previous action.
  • Loading branch information
ramonjd committed Nov 6, 2023
1 parent b4857fd commit 66337ff
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
);

function ScreenRevisions() {
const { goBack } = useNavigator();
const { goTo } = useNavigator();
const { user: userConfig, setUserConfig } =
useContext( GlobalStylesContext );
const { blocks, editorCanvasContainerView } = useSelect( ( select ) => {
Expand All @@ -58,13 +58,13 @@ function ScreenRevisions() {

useEffect( () => {
if ( editorCanvasContainerView !== 'global-styles-revisions' ) {
goBack();
goTo( '/' ); // Return global styles main panel.
setEditorCanvasContainerView( editorCanvasContainerView );
}
}, [ editorCanvasContainerView ] );

const onCloseRevisions = () => {
goBack();
goTo( '/' ); // Return global styles main panel.
};

const restoreRevision = ( revision ) => {
Expand Down

0 comments on commit 66337ff

Please sign in to comment.