From a2d35b056373b82a783676b93a4176ddc166b541 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Tue, 13 Feb 2024 14:03:06 +0100 Subject: [PATCH] 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 --- .../client/customize-store/design-without-ai/services.ts | 5 +++++ .../client/customize-store/intro/services.ts | 2 +- ...ed-on-the-cys-loading-screen-when-the-user-did-not-opt-in | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/44552-cys-core-ensure-that-fonts-arent-installed-on-the-cys-loading-screen-when-the-user-did-not-opt-in diff --git a/plugins/woocommerce-admin/client/customize-store/design-without-ai/services.ts b/plugins/woocommerce-admin/client/customize-store/design-without-ai/services.ts index e7b029f19e3..d7ae142e0c3 100644 --- a/plugins/woocommerce-admin/client/customize-store/design-without-ai/services.ts +++ b/plugins/woocommerce-admin/client/customize-store/design-without-ai/services.ts @@ -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' diff --git a/plugins/woocommerce-admin/client/customize-store/intro/services.ts b/plugins/woocommerce-admin/client/customize-store/intro/services.ts index e8e74ef00c3..950cdcc4425 100644 --- a/plugins/woocommerce-admin/client/customize-store/intro/services.ts +++ b/plugins/woocommerce-admin/client/customize-store/intro/services.ts @@ -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', } ); diff --git a/plugins/woocommerce/changelog/44552-cys-core-ensure-that-fonts-arent-installed-on-the-cys-loading-screen-when-the-user-did-not-opt-in b/plugins/woocommerce/changelog/44552-cys-core-ensure-that-fonts-arent-installed-on-the-cys-loading-screen-when-the-user-did-not-opt-in new file mode 100644 index 00000000000..8063a0a8ca1 --- /dev/null +++ b/plugins/woocommerce/changelog/44552-cys-core-ensure-that-fonts-arent-installed-on-the-cys-loading-screen-when-the-user-did-not-opt-in @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS - Core: install fonts only when the tracking is enabled