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

Prevent infinite redirect after processing site on onboarding flow #98084

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions client/landing/stepper/hooks/use-record-signup-complete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const useRecordSignupComplete = ( flow: string | null ) => {

const theme = site?.options?.theme_slug || selectedDesign?.slug || '';

// Avoid generating new reference on each call
const stringifiedGoals = goals.length && goals?.join( ',' );

return useCallback(
( signupCompletionState: Record< string, unknown > ) => {
const isNewUser = getSignupIsNewUserAndClear( userId ) ?? false;
Expand Down Expand Up @@ -70,7 +73,7 @@ export const useRecordSignupComplete = ( flow: string | null ) => {
hasPaidDomainItem && domainCartItem ? isDomainTransfer( domainCartItem ) : undefined,
signupDomainOrigin: signupDomainOrigin ?? SIGNUP_DOMAIN_ORIGIN.NOT_SET,
framework: 'stepper',
goals: goals.length && goals?.join( ',' ),
goals: stringifiedGoals,
},
true
);
Expand All @@ -84,7 +87,7 @@ export const useRecordSignupComplete = ( flow: string | null ) => {
siteId,
theme,
userId,
goals,
stringifiedGoals,
]
);
};
Loading