Mark completedForDevice prior to creating an account

This commit is contained in:
Eric Bailey
2025-08-11 15:24:37 -05:00
parent bb949e4f44
commit 3e880b07dd
+9 -6
View File
@@ -308,6 +308,15 @@ export function useSubmitSignup() {
dispatch({type: 'setIsLoading', value: true})
try {
/**
* Marks any active policy update as completed, since user just agreed
* to TOS/privacy during sign up.
*
* THIS MUST RUN BEFORE createAccount, which will re-render the whole
* app with the new account.
*/
preemptivelyCompleteActivePolicyUpdate()
await createAccount(
{
service: state.serviceUrl,
@@ -328,12 +337,6 @@ export function useSubmitSignup() {
},
)
/**
* Marks any active policy update as completed, since user just agreed
* to TOS/privacy during sign up
*/
preemptivelyCompleteActivePolicyUpdate()
/*
* Must happen last so that if the user has multiple tabs open and
* createAccount fails, one tab is not stuck in onboarding — Eric