diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx index d05f0fa5c64a..5fbab0755f2f 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx @@ -5,6 +5,7 @@ import {View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; +import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import {useSession} from '@components/OnyxProvider'; import ReimbursementAccountLoadingIndicator from '@components/ReimbursementAccountLoadingIndicator'; @@ -136,7 +137,7 @@ function getFieldsForStep(step: TBankAccountStep): InputID[] { } } -function ReimbursementAccountPage({route, policy}: ReimbursementAccountPageProps) { +function ReimbursementAccountPage({route, policy, isLoadingPolicy}: ReimbursementAccountPageProps) { const session = useSession(); const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT); const [plaidLinkToken = ''] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN); @@ -415,6 +416,10 @@ function ReimbursementAccountPage({route, policy}: ReimbursementAccountPageProps ].some((value) => value === currentStep) ); + if (isLoadingPolicy) { + return ; + } + // Show loading indicator when page is first time being opened and props.reimbursementAccount yet to be loaded from the server // or when data is being loaded. Don't show the loading indicator if we're offline and restarted the bank account setup process // On Android, when we open the app from the background, Onfido activity gets destroyed, so we need to reopen it.