Update core profiler redirect to jetpack screen logic (#52095)

* Update core profiler redirect to jetpack screen logic

* Add changelog

* Only redirect when jetpack is selected
This commit is contained in:
Chi-Hsuan Huang 2024-10-17 16:34:12 -05:00 committed by GitHub
parent 9e83d0cd6a
commit c9ab2d67af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 14 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Update core profiler redirect to jetpack screen logic

View File

@ -1338,16 +1338,7 @@ export const coreProfilerStateMachineDefinition = createMachine( {
} ); } );
return promiseDelay( 3000 ); return promiseDelay( 3000 );
} ), } ),
onDone: [ onDone: [ { actions: [ 'redirectToWooHome' ] } ],
{
target: 'isJetpackConnected',
guard: or( [
'hasJetpackSelectedForInstallation',
'hasJetpackActivated',
] ),
},
{ actions: [ 'redirectToWooHome' ] },
],
}, },
meta: { meta: {
component: CoreProfilerLoader, component: CoreProfilerLoader,
@ -1419,10 +1410,7 @@ export const coreProfilerStateMachineDefinition = createMachine( {
onDone: [ onDone: [
{ {
target: 'isJetpackConnected', target: 'isJetpackConnected',
guard: or( [ guard: 'hasJetpackSelectedForInstallation',
'hasJetpackSelectedForInstallation',
'hasJetpackActivated',
] ),
}, },
{ actions: 'redirectToWooHome' }, { actions: 'redirectToWooHome' },
], ],