From 439a3c471f3f69d1e4c8dd87e9f1dc3852b45247 Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Thu, 19 Oct 2023 20:11:21 +0530 Subject: [PATCH] Prevent redundant API calls --- src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.js | 4 ++-- .../settings/Security/TwoFactorAuth/TwoFactorAuthPropTypes.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.js b/src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.js index 7340a1f64511..d601d197de4a 100644 --- a/src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.js +++ b/src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.js @@ -32,11 +32,11 @@ function CodesStep({account = defaultAccount}) { const {setStep} = useTwoFactorAuthContext(); useEffect(() => { - if (account.recoveryCodes) { + if (account.requiresTwoFactorAuth || account.recoveryCodes) { return; } Session.toggleTwoFactorAuth(true); - }, [account.recoveryCodes]); + }, []); return (