From 94800c609bd4158c646620bf30e039a509d50277 Mon Sep 17 00:00:00 2001 From: Aswin S Date: Tue, 6 Feb 2024 00:31:15 +0530 Subject: [PATCH] fix: wait for navigation ready before redirecting user --- src/pages/ValidateLoginPage/index.website.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 08f0a64d1a0d..6253535e9789 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -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); @@ -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 (