CYS - Core: catch error when font installation fails (#44559)
* CYS - Core: catch error when font installation fails * add changelog * reduce the requests number
This commit is contained in:
parent
75791b2aff
commit
69728b70e9
|
@ -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';
|
||||
|
@ -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',
|
||||
} );
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: enhancement
|
||||
|
||||
CYS - Core: catch error when font installation fails.
|
Loading…
Reference in New Issue