From 41ee713c92e7f6389049245e4251c7c9f4801088 Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Tue, 23 Apr 2024 14:49:10 +0530 Subject: [PATCH] Revert "Fix here is your magic code shows briefly when login with magic link" --- src/pages/ValidateLoginPage/index.website.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 035ad1492f01..b8e8709215e8 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -24,11 +24,9 @@ function ValidateLoginPage({ const isSignedIn = !!session?.authToken && session?.authTokenType !== CONST.AUTH_TOKEN_TYPES.ANONYMOUS; const is2FARequired = !!account?.requiresTwoFactorAuth; const cachedAccountID = credentials?.accountID; - const isUserClickedSignIn = !login && isSignedIn && (autoAuthState === CONST.AUTO_AUTH_STATE.SIGNING_IN || autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN); - const shouldStartSignInWithValidateCode = !isUserClickedSignIn && !isSignedIn && (!!login || !!exitTo); useEffect(() => { - if (isUserClickedSignIn) { + 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.isNavigationReady().then(() => { Navigation.goBack(); @@ -37,7 +35,7 @@ function ValidateLoginPage({ } Session.initAutoAuthState(autoAuthState); - if (!shouldStartSignInWithValidateCode) { + if (isSignedIn || (!login && !exitTo)) { if (exitTo) { Session.handleExitToNavigation(exitTo); } @@ -73,13 +71,13 @@ function ValidateLoginPage({ {autoAuthState === CONST.AUTO_AUTH_STATE.FAILED && } {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && is2FARequired && !isSignedIn && } {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && } - {autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo && !shouldStartSignInWithValidateCode && ( + {autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo && ( )} - {(autoAuthState === CONST.AUTO_AUTH_STATE.SIGNING_IN || shouldStartSignInWithValidateCode) && } + {autoAuthState === CONST.AUTO_AUTH_STATE.SIGNING_IN && } ); }