Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Library: Prevent error when installing a system font twice #58141

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,15 @@ function FontLibraryProvider( { children } ) {

// Use the sucessfully installed font faces
// As well as any font faces that were already installed (those will be activated)
fontFamilyToInstall.fontFace = [
...sucessfullyInstalledFontFaces,
...alreadyInstalledFontFaces,
];
if (
sucessfullyInstalledFontFaces?.length > 0 ||
alreadyInstalledFontFaces?.length > 0
) {
fontFamilyToInstall.fontFace = [
...sucessfullyInstalledFontFaces,
...alreadyInstalledFontFaces,
];
}

// Activate the font family (add the font family to the global styles).
activateCustomFontFamilies( [ fontFamilyToInstall ] );
Expand Down
Loading