Skip to content

Commit

Permalink
Reorder Not Found view logic to be calculated after Loading Indicator…
Browse files Browse the repository at this point in the history
… logic.
  • Loading branch information
neonbhai committed Jan 7, 2024
1 parent 0c351a4 commit e27bda2
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 (_.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 e27bda2

Please sign in to comment.