From f1c026d4a0c02d81243c65f235a1bab7f1985d97 Mon Sep 17 00:00:00 2001 From: Jack Nam <30609178+thienlnam@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:00:42 +0800 Subject: [PATCH] Merge pull request #27938 from margelo/osp/fix-inconsistent-navigation-in-2fa (cherry picked from commit d7714983a9a87bc908f12b33ad95daeb5a20c1be) --- .../settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js b/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js index e0094267742b..58852c1dba02 100644 --- a/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js +++ b/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js @@ -24,14 +24,13 @@ function TwoFactorAuthSteps({account = defaultAccount}) { setCurrentStep(account.twoFactorAuthStep); return; } + if (account.requiresTwoFactorAuth) { setCurrentStep(CONST.TWO_FACTOR_AUTH_STEPS.ENABLED); } else { setCurrentStep(CONST.TWO_FACTOR_AUTH_STEPS.CODES); } - // we don't want to trigger the hook every time the step changes, only when the requiresTwoFactorAuth changes - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [account.requiresTwoFactorAuth]); + }, [account.requiresTwoFactorAuth, account.twoFactorAuthStep]); const handleSetStep = useCallback( (step, animationDirection = CONST.ANIMATION_DIRECTION.IN) => {