diff --git a/packages/edit-site/src/components/global-styles/font-sizes/font-size.js b/packages/edit-site/src/components/global-styles/font-sizes/font-size.js index b99703d39c8d62..43418f9caf5eb6 100644 --- a/packages/edit-site/src/components/global-styles/font-sizes/font-size.js +++ b/packages/edit-site/src/components/global-styles/font-sizes/font-size.js @@ -36,7 +36,7 @@ function FontSize() { const { params: { origin, slug }, - goTo, + goBack, } = useNavigator(); const [ fontSizes, setFontSizes ] = useGlobalSetting( @@ -53,10 +53,10 @@ function FontSize() { // Navigate to the font sizes list if the font size is not available. useEffect( () => { - if ( ! fontSize ) { - goTo( '/typography/font-sizes/', { isBack: true } ); + if ( !! slug && ! fontSize ) { + goBack(); } - }, [ fontSize, goTo ] ); + }, [ slug, fontSize, goBack ] ); if ( ! origin || ! slug || ! fontSize ) { return null; @@ -158,7 +158,6 @@ function FontSize() { __( 'Manage the font size %s.' ), fontSize.name ) } - onBack={ () => goTo( '/typography/font-sizes/' ) } /> { origin === 'custom' && ( diff --git a/packages/edit-site/src/components/global-styles/font-sizes/font-sizes-count.js b/packages/edit-site/src/components/global-styles/font-sizes/font-sizes-count.js index 8c8c79772ecbf3..c268648a134a74 100644 --- a/packages/edit-site/src/components/global-styles/font-sizes/font-sizes-count.js +++ b/packages/edit-site/src/components/global-styles/font-sizes/font-sizes-count.js @@ -24,7 +24,7 @@ function FontSizes() { diff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js index fbc3e461e6abb6..d534da901cd2e2 100644 --- a/packages/edit-site/src/components/global-styles/ui.js +++ b/packages/edit-site/src/components/global-styles/ui.js @@ -302,7 +302,7 @@ function GlobalStylesUI() { - +