Skip to content

Commit

Permalink
Add back_url to DIFM and hosted-site-migration flows
Browse files Browse the repository at this point in the history
  • Loading branch information
zaguiini committed Dec 20, 2024
1 parent 4def41d commit 04c6218
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions client/landing/stepper/declarative-flow/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ const onboarding: Flow = {
const submit = async ( providedDependencies: ProvidedDependencies = {} ) => {
switch ( currentStepSlug ) {
case 'goals': {
const goalsUrl =
locale && locale !== 'en'
? `/setup/onboarding/goals/${ locale }`
: '/setup/onboarding/goals';

const { intent } = providedDependencies;

switch ( intent ) {
Expand All @@ -114,7 +119,11 @@ const onboarding: Flow = {
locale && locale !== 'en'
? `/setup/hosted-site-migration/${ locale }`
: '/setup/hosted-site-migration';
return window.location.assign( migrationFlowLink );
return window.location.assign(
addQueryArgs( migrationFlowLink, {
back_url: goalsUrl,
} )
);
}

case SiteIntent.DIFM: {
Expand All @@ -123,7 +132,11 @@ const onboarding: Flow = {
? `/start/do-it-for-me/${ locale }`
: '/start/do-it-for-me';

return window.location.assign( difmFlowLink );
return window.location.assign(
addQueryArgs( difmFlowLink, {
back_url: goalsUrl,
} )
);
}

default: {
Expand Down

0 comments on commit 04c6218

Please sign in to comment.