Skip to content

Commit

Permalink
fix: wait for navigation ready before redirecting user
Browse files Browse the repository at this point in the history
  • Loading branch information
aswin-s committed Feb 5, 2024
1 parent 5133c29 commit 94800c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/ValidateLoginPage/index.website.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function ValidateLoginPage({
useEffect(() => {
if (!login && isSignedIn && (autoAuthState === CONST.AUTO_AUTH_STATE.SIGNING_IN || autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN)) {
// The user clicked the option to sign in the current tab
Navigation.navigate();
Navigation.isNavigationReady().then(() => {
Navigation.goBack();
});
return;
}
Session.initAutoAuthState(autoAuthState);
Expand All @@ -47,7 +49,9 @@ function ValidateLoginPage({
}

// The user clicked the option to sign in the current tab
Navigation.navigate();
Navigation.isNavigationReady().then(() => {
Navigation.goBack();
});
}, [login, cachedAccountID, is2FARequired]);

return (
Expand Down

0 comments on commit 94800c6

Please sign in to comment.