CYS - Core: install fonts only when the tracking is enabled (#44558)

* CYS - Core: install fonts only when the tracking is enabled

* add a parameter to reduce the response payload

* add changelog
This commit is contained in:
Luigi Teschio 2024-02-13 14:03:06 +01:00 committed by GitHub
parent 8d5c0dae83
commit a2d35b0563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -63,6 +63,11 @@ const installAndActivateTheme = async () => {
};
const installFontFamilies = async () => {
const isTrackingEnabled = window.wcTracks?.isEnabled || false;
if ( ! isTrackingEnabled ) {
return;
}
try {
const installedFontFamily = ( await resolveSelect(
'core'

View File

@ -115,7 +115,7 @@ export const fetchIntroData = async () => {
const fetchIsFontLibraryAvailable = async () => {
try {
await apiFetch( {
path: '/wp/v2/font-collections',
path: '/wp/v2/font-collections?_fields=slug',
method: 'GET',
} );

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
CYS - Core: install fonts only when the tracking is enabled