From 194adfa840c649cf343a40957f230b861a50c22d Mon Sep 17 00:00:00 2001 From: zfurtak Date: Fri, 18 Oct 2024 09:35:31 +0100 Subject: [PATCH] Adjusted to review --- .../ConnectToXeroFlow/index.native.tsx | 20 ++++++++++--------- src/components/ConnectToXeroFlow/index.tsx | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/ConnectToXeroFlow/index.native.tsx b/src/components/ConnectToXeroFlow/index.native.tsx index 34e55fcb8598..fbf7bf01ab5c 100644 --- a/src/components/ConnectToXeroFlow/index.native.tsx +++ b/src/components/ConnectToXeroFlow/index.native.tsx @@ -40,15 +40,17 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) { return ( <> - { - setIsRequire2FAModalOpen(false); - Navigation.navigate(ROUTES.SETTINGS_2FA.getRoute(ROUTES.POLICY_ACCOUNTING.getRoute(policyID), getXeroSetupLink(policyID))); - }} - onCancel={() => setIsRequire2FAModalOpen(false)} - isVisible={isRequire2FAModalOpen} - description={translate('twoFactorAuth.twoFactorAuthIsRequiredDescription')} - /> + {!is2FAEnabled && ( + { + setIsRequire2FAModalOpen(false); + Navigation.navigate(ROUTES.SETTINGS_2FA.getRoute(ROUTES.POLICY_ACCOUNTING.getRoute(policyID), getXeroSetupLink(policyID))); + }} + onCancel={() => setIsRequire2FAModalOpen(false)} + isVisible={isRequire2FAModalOpen} + description={translate('twoFactorAuth.twoFactorAuthIsRequiredDescription')} + /> + )} setWebViewOpen(false)} fullscreen diff --git a/src/components/ConnectToXeroFlow/index.tsx b/src/components/ConnectToXeroFlow/index.tsx index 5d0e88e1512b..ad41ba8082b1 100644 --- a/src/components/ConnectToXeroFlow/index.tsx +++ b/src/components/ConnectToXeroFlow/index.tsx @@ -29,7 +29,7 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - if (isRequire2FAModalOpen) { + if (!is2FAEnabled) { return ( { @@ -39,7 +39,7 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) { onCancel={() => { setIsRequire2FAModalOpen(false); }} - isVisible + isVisible={isRequire2FAModalOpen} description={translate('twoFactorAuth.twoFactorAuthIsRequiredDescription')} /> );