Skip to content

Commit

Permalink
Merge pull request #27938 from margelo/osp/fix-inconsistent-navigatio…
Browse files Browse the repository at this point in the history
…n-in-2fa

(cherry picked from commit d771498)
  • Loading branch information
thienlnam authored and OSBotify committed Sep 22, 2023
1 parent 945bd95 commit f1c026d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit f1c026d

Please sign in to comment.