Skip to content

Commit

Permalink
Merge pull request #34117 from neonbhai/bank-account-deeplink-fix
Browse files Browse the repository at this point in the history
Connect Bank Account Redirection Fix
  • Loading branch information
blimpich authored Jan 17, 2024
2 parents 0c599f0 + 821d6d7 commit 6089720
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,6 @@ function ReimbursementAccountPage({reimbursementAccount, route, onfidoToken, pol
}
};

if (_.isEmpty(policy) || !PolicyUtils.isPolicyAdmin(policy)) {
return (
<ScreenWrapper testID={ReimbursementAccountPage.displayName}>
<FullPageNotFoundView
shouldShow
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
subtitleKey={_.isEmpty(policy) ? undefined : 'workspace.common.notAuthorized'}
/>
</ScreenWrapper>
);
}

const isLoading = (isLoadingApp || account.isLoading || reimbursementAccount.isLoading) && (!plaidCurrentEvent || plaidCurrentEvent === CONST.BANK_ACCOUNT.PLAID.EVENTS_NAME.EXIT);
const shouldShowOfflineLoader = !(
isOffline && _.contains([CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT, CONST.BANK_ACCOUNT.STEP.COMPANY, CONST.BANK_ACCOUNT.STEP.REQUESTOR, CONST.BANK_ACCOUNT.STEP.ACH_CONTRACT], currentStep)
Expand All @@ -427,6 +415,18 @@ function ReimbursementAccountPage({reimbursementAccount, route, onfidoToken, pol
);
}

if (!isLoading && (_.isEmpty(policy) || !PolicyUtils.isPolicyAdmin(policy))) {
return (
<ScreenWrapper testID={ReimbursementAccountPage.displayName}>
<FullPageNotFoundView
shouldShow
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
subtitleKey={_.isEmpty(policy) ? undefined : 'workspace.common.notAuthorized'}
/>
</ScreenWrapper>
);
}

let errorText;
const userHasPhonePrimaryEmail = Str.endsWith(session.email, CONST.SMS.DOMAIN);
const throttledDate = lodashGet(reimbursementAccount, 'throttledDate', '');
Expand Down

0 comments on commit 6089720

Please sign in to comment.