diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/context.js b/packages/edit-site/src/components/global-styles/font-library-modal/context.js index e0749845788d60..364742901bd5fe 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/context.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/context.js @@ -213,14 +213,13 @@ function FontLibraryProvider( { children } ) { 'settings.typography.fontFamilies', ] ); refreshLibrary(); - setIsInstalling( false ); - return response; } catch ( error ) { - setIsInstalling( false ); return { errors: [ error ], }; + } finally { + setIsInstalling( false ); } } 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 d493a2a297b18b..0a9e29892be47f 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 @@ -77,6 +77,7 @@ function InstalledFonts() { !! libraryFontSelected && libraryFontSelected?.source !== 'theme'; useEffect( () => { + handleSelectFont( libraryFontSelected ); refreshLibrary(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [] );