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')} /> );