[CYS - Core] improve logic to find active fonts (#44724)

* improve logic to find active fonts

* Add changefile(s) from automation for the following project(s): woocommerce

* Update changelog

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
This commit is contained in:
Luigi Teschio 2024-02-20 10:48:09 +01:00 committed by GitHub
parent 484398cfe1
commit 62f2782715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -95,10 +95,10 @@ export const VariationContainer = ( { variation, children } ) => {
// With the Font Library, the fontFamilies object contains an array of font families installed with the Font Library under the key 'custom'.
// We need to compare only the active theme font families, so we compare the theme font families with the current variation.
const { theme } = user.settings.typography.fontFamilies;
return isEqual( variation.settings.typography, {
fontFamilies: { theme },
} );
return variation.settings.typography?.fontFamilies.theme.every(
( { slug } ) =>
theme.some( ( { slug: themeSlug } ) => themeSlug === slug )
);
}, [ user, variation ] );
let label = variation?.title;

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: [CYS - Core] improve logic to find active fonts