File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/edit-site/src/components/global-styles/font-library-modal Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,18 @@ function FontLibraryProvider( { children } ) {
101101 . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
102102 : [ ] ;
103103
104- const customFonts = fontFamilies ?. custom
105- ? fontFamilies . custom
104+ const baseCustomFonts = libraryFonts
105+ ? libraryFonts
106106 . map ( ( f ) => setUIValuesNeeded ( f , { source : 'custom' } ) )
107107 . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
108108 : [ ] ;
109109
110- const baseCustomFonts = libraryFonts
111- ? libraryFonts
110+ const customFonts = fontFamilies ?. custom
111+ ? fontFamilies . custom
112112 . map ( ( f ) => setUIValuesNeeded ( f , { source : 'custom' } ) )
113+ . filter ( ( f ) =>
114+ baseCustomFonts . some ( ( bf ) => bf . slug === f . slug )
115+ ) // Ensures that the font actually exists in the library.
113116 . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
114117 : [ ] ;
115118
You can’t perform that action at this time.
0 commit comments