Skip to content

Commit

Permalink
CYS - Core: catch error when font installation fails (#44559)
Browse files Browse the repository at this point in the history
* CYS - Core: catch error when font installation fails

* add changelog

* reduce the requests number
  • Loading branch information
gigitux committed Feb 13, 2024
1 parent 75791b2 commit 69728b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
installFontFace,
installFontFamily,
getFontFamiliesAndFontFaceToInstall,
FontCollectionsResponse,
} from './fonts';
import { COLOR_PALETTES } from '../assembler-hub/sidebar/global-styles/color-palette-variations/constants';
import { FONT_PAIRINGS_WHEN_AI_IS_OFFLINE } from '../assembler-hub/sidebar/global-styles/font-pairing-variations/constants';
Expand Down Expand Up @@ -93,13 +92,8 @@ const installFontFamilies = async () => {
} )
);

const fontCollections = await apiFetch< FontCollectionsResponse >( {
path: '/wp/v2/font-collections?_fields=slug,name,description,id',
method: 'GET',
} );

const fontCollection = await apiFetch< FontCollectionResponse >( {
path: `/wp/v2/font-collections/${ fontCollections[ 0 ].slug }`,
path: `/wp/v2/font-collections/google-fonts`,
method: 'GET',
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,10 @@ export const designWithNoAiStateMachineDefinition = createMachine(
onDone: {
target: 'success',
},
// TODO: Handle error case: https://github.com/woocommerce/woocommerce/issues/43780
// onError: {
// actions: [
// 'assignAPICallLoaderError',
// ],
// },
onError: {
actions:
'redirectToIntroWithError',
},
},
},
success: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

CYS - Core: catch error when font installation fails.

0 comments on commit 69728b7

Please sign in to comment.