From ad44534501ad6c2de7af59ee9af20449a92f44a4 Mon Sep 17 00:00:00 2001 From: Morgan McCauley Date: Mon, 28 Mar 2022 16:48:50 +1300 Subject: [PATCH] fix(2fa): Only display 'resent' UI on success --- .../accounts/two_factor/TwoFactorVerifyModal.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/accounts/two_factor/TwoFactorVerifyModal.js b/packages/frontend/src/components/accounts/two_factor/TwoFactorVerifyModal.js index ee3d948fc0..4f5afd11b4 100644 --- a/packages/frontend/src/components/accounts/two_factor/TwoFactorVerifyModal.js +++ b/packages/frontend/src/components/accounts/two_factor/TwoFactorVerifyModal.js @@ -95,15 +95,15 @@ const TwoFactorVerifyModal = ({ open, onClose }) => { const handleResendCode = async () => { setResendCode('resending'); await Mixpanel.withTracking('2FA Modal Resend code', - async () => await dispatch(resendTwoFactor()), + async () => { + await dispatch(resendTwoFactor()); + setResendCode('resent'); + setTimeout(() => { setResendCode(); }, 3000); + }, (e) => { setResendCode(); throw e; }, - () => { - setResendCode('resent'); - setTimeout(() => { setResendCode(); }, 3000); - } ); };