[CYS] Improve logic to ensure that the font is active (#45385)
* improve logic to ensure that the font is active * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
60d93e447f
commit
76e7d84523
|
@ -115,9 +115,13 @@ 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 variation.settings.typography?.fontFamilies.theme.every(
|
||||
( { slug } ) =>
|
||||
theme.some( ( { slug: themeSlug } ) => themeSlug === slug )
|
||||
return (
|
||||
variation.settings.typography?.fontFamilies.theme.every(
|
||||
( { slug } ) =>
|
||||
theme.some( ( { slug: themeSlug } ) => themeSlug === slug )
|
||||
) &&
|
||||
theme.length ===
|
||||
variation.settings.typography?.fontFamilies.theme.length
|
||||
);
|
||||
}, [ user, variation ] );
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
[CYS] Improve logic to ensure that the font is active.
|
Loading…
Reference in New Issue