add: lys prefetch congrats data (#46406)

This commit is contained in:
RJ 2024-04-11 12:48:40 +08:00 committed by GitHub
parent 5a57525bd6
commit 09b002cb50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import {
fromCallback,
fromPromise,
assign,
spawnChild,
} from 'xstate5';
import React from 'react';
import classnames from 'classnames';
@ -23,6 +24,7 @@ import type { LaunchYourStoreComponentProps } from '..';
import type { mainContentMachine } from '../main-content/xstate';
import { updateQueryParams, createQueryParamsListener } from '../common';
import { taskClickedAction, getLysTasklist } from './tasklist';
import { fetchCongratsData } from '../main-content/pages/launch-store-success/services';
export type SidebarMachineContext = {
externalUrl: string | null;
@ -116,6 +118,7 @@ export const sidebarMachine = setup( {
sidebarQueryParamListener,
getTasklist: fromPromise( getLysTasklist ),
updateLaunchStoreOptions: fromPromise( launchStoreAction ),
fetchCongratsData,
},
} ).createMachine( {
id: 'sidebar',
@ -155,6 +158,11 @@ export const sidebarMachine = setup( {
initial: 'preLaunchYourStoreHub',
states: {
preLaunchYourStoreHub: {
entry: [
spawnChild( 'fetchCongratsData', {
id: 'prefetch-congrats-data ',
} ),
],
invoke: {
src: 'getTasklist',
onDone: {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: add
Adds a prefetch for the LYS congrats data