Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ai status missing on CYS transitional page #44121

Merged
merged 3 commits into from Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 24 additions & 2 deletions plugins/woocommerce-admin/client/customize-store/index.tsx
Expand Up @@ -459,14 +459,36 @@ export const customizeStoreStateMachineDefinition = createMachine( {
invoke: {
src: 'fetchSurveyCompletedOption',
onError: {
target: 'transitional', // leave it as initialised default on error
target: 'preCheckAiStatus', // leave it as initialised default on error
},
onDone: {
target: 'transitional',
target: 'preCheckAiStatus',
actions: [ 'assignHasCompleteSurvey' ],
},
},
},
preCheckAiStatus: {
always: [
{
cond: 'isWooExpress',
target: 'checkAiStatus',
},
{ cond: 'isNotWooExpress', target: 'transitional' },
],
},
checkAiStatus: {
invoke: {
src: 'fetchAiStatus',
onDone: {
actions: 'assignAiStatus',
target: 'transitional',
},
onError: {
actions: 'assignAiOffline',
target: 'transitional',
},
},
},
transitional: {
entry: [
{ type: 'updateQueryStep', step: 'transitional' },
Expand Down
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Fix the missing AI status when reloading the CYS transitional page.