Commit d1933ab 1 parent 428ef1f commit d1933ab Copy full SHA for d1933ab
File tree 1 file changed +13
-2
lines changed
packages/edit-site/src/components/global-styles/font-library-modal
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ function InstalledFonts() {
102
102
handleBack = { ! ! libraryFontSelected && handleUnselectFont }
103
103
footer = {
104
104
< Footer
105
+ libraryFontSelected = { libraryFontSelected }
105
106
shouldDisplayDeleteButton = { shouldDisplayDeleteButton }
106
107
handleUninstallClick = { handleUninstallClick }
107
108
/>
@@ -172,13 +173,23 @@ function InstalledFonts() {
172
173
) ;
173
174
}
174
175
175
- function Footer ( { shouldDisplayDeleteButton, handleUninstallClick } ) {
176
+ function Footer ( {
177
+ shouldDisplayDeleteButton,
178
+ handleUninstallClick,
179
+ libraryFontSelected,
180
+ } ) {
176
181
const { saveFontFamilies, fontFamiliesHasChanges, isInstalling } =
177
182
useContext ( FontLibraryContext ) ;
178
183
184
+ const customFontFamilyId =
185
+ libraryFontSelected ?. source === 'custom' && libraryFontSelected ?. id ;
186
+
179
187
const canUserDelete = useSelect ( ( select ) => {
180
188
const { canUser } = select ( coreStore ) ;
181
- return canUser ( 'delete' , 'font-families' ) ;
189
+ return (
190
+ customFontFamilyId &&
191
+ canUser ( 'delete' , 'font-families' , customFontFamilyId )
192
+ ) ;
182
193
} ) ;
183
194
184
195
return (
You can’t perform that action at this time.
0 commit comments