diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index 5119ca679e40ad..7a05a66c6efdfe 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -26,7 +26,7 @@ import { unlock } from '../../lock-unlock'; const { useGlobalSetting } = unlock( blockEditorPrivateApis ); function FontFamilies() { - const { baseCustomFonts, modalTabOpen, setModalTabOpen } = + const { baseCustomFonts, modalTabOpen, setModalTabOpen, setNotice } = useContext( FontLibraryContext ); const [ fontFamilies ] = useGlobalSetting( 'typography.fontFamilies' ); const [ baseFontFamilies ] = useGlobalSetting( @@ -111,13 +111,15 @@ function FontFamilies() { className="edit-site-global-styles-font-families__manage-fonts" variant="secondary" __next40pxDefaultSize - onClick={ () => + onClick={ () => { + // Reset notice when opening the modal. + setNotice( null ); setModalTabOpen( hasInstalledFonts ? 'installed-fonts' : 'upload-fonts' - ) - } + ); + } } > { hasInstalledFonts ? __( 'Manage fonts' ) diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js b/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js index f3c8d73eef307e..76618a54aeb92f 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js @@ -148,6 +148,7 @@ function InstalledFonts() { refreshLibrary(); }, [] ); + const hasFonts = baseThemeFonts.length > 0 || baseCustomFonts.length > 0; return (