From e27bda2f1f116bb67fd244c59f8da7ccc4b36b76 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 8 Jan 2024 01:03:01 +0530 Subject: [PATCH] Reorder Not Found view logic to be calculated after Loading Indicator logic. --- .../ReimbursementAccountPage.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index 81d4af93d86c..e7476ba8fcdb 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -397,18 +397,6 @@ function ReimbursementAccountPage({reimbursementAccount, route, onfidoToken, pol } }; - if (_.isEmpty(policy) || !PolicyUtils.isPolicyAdmin(policy)) { - return ( - - Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} - subtitleKey={_.isEmpty(policy) ? undefined : 'workspace.common.notAuthorized'} - /> - - ); - } - 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) @@ -427,6 +415,18 @@ function ReimbursementAccountPage({reimbursementAccount, route, onfidoToken, pol ); } + if (_.isEmpty(policy) || !PolicyUtils.isPolicyAdmin(policy)) { + return ( + + Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} + subtitleKey={_.isEmpty(policy) ? undefined : 'workspace.common.notAuthorized'} + /> + + ); + } + let errorText; const userHasPhonePrimaryEmail = Str.endsWith(session.email, CONST.SMS.DOMAIN); const throttledDate = lodashGet(reimbursementAccount, 'throttledDate', '');