Skip to content

Commit

Permalink
Adjusted to review
Browse files Browse the repository at this point in the history
  • Loading branch information
zfurtak committed Oct 18, 2024
1 parent bca11fb commit 194adfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions src/components/ConnectToXeroFlow/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) {

return (
<>
<RequireTwoFactorAuthenticationModal
onSubmit={() => {
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 && (
<RequireTwoFactorAuthenticationModal
onSubmit={() => {
setIsRequire2FAModalOpen(false);
Navigation.navigate(ROUTES.SETTINGS_2FA.getRoute(ROUTES.POLICY_ACCOUNTING.getRoute(policyID), getXeroSetupLink(policyID)));
}}
onCancel={() => setIsRequire2FAModalOpen(false)}
isVisible={isRequire2FAModalOpen}
description={translate('twoFactorAuth.twoFactorAuthIsRequiredDescription')}
/>
)}
<Modal
onClose={() => setWebViewOpen(false)}
fullscreen
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConnectToXeroFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

if (isRequire2FAModalOpen) {
if (!is2FAEnabled) {
return (
<RequireTwoFactorAuthenticationModal
onSubmit={() => {
Expand All @@ -39,7 +39,7 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) {
onCancel={() => {
setIsRequire2FAModalOpen(false);
}}
isVisible
isVisible={isRequire2FAModalOpen}
description={translate('twoFactorAuth.twoFactorAuthIsRequiredDescription')}
/>
);
Expand Down

0 comments on commit 194adfa

Please sign in to comment.