diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx index f750b574468d..68590c134298 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx @@ -190,9 +190,15 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: return; } + // If USD bank account is in pending state, we should navigate straight to the validation step and skip Continue step + if (policyCurrency === CONST.CURRENCY.USD && achData?.state === CONST.BANK_ACCOUNT.STATE.PENDING) { + setUSDBankAccountStep(CONST.BANK_ACCOUNT.STEP.VALIDATION); + return; + } + setShouldShowConnectedVerifiedBankAccount(isNonUSDWorkspace ? achData?.state === CONST.BANK_ACCOUNT.STATE.OPEN : achData?.currentStep === CONST.BANK_ACCOUNT.STEP.ENABLE); setShouldShowContinueSetupButton(shouldShowContinueSetupButtonValue); - }, [achData?.currentStep, shouldShowContinueSetupButtonValue, isNonUSDWorkspace, isPreviousPolicy, achData?.state]); + }, [achData?.currentStep, shouldShowContinueSetupButtonValue, isNonUSDWorkspace, isPreviousPolicy, achData?.state, policyCurrency]); useEffect( () => { @@ -354,9 +360,6 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: case CONST.BANK_ACCOUNT.STEP.VALIDATION: if ([CONST.BANK_ACCOUNT.STATE.VERIFYING, CONST.BANK_ACCOUNT.STATE.SETUP].some((value) => value === achData?.state)) { goToWithdrawalAccountSetupStep(CONST.BANK_ACCOUNT.STEP.ACH_CONTRACT); - } else if (!isOffline && achData?.state === CONST.BANK_ACCOUNT.STATE.PENDING) { - setShouldShowContinueSetupButton(true); - setUSDBankAccountStep(null); } else { Navigation.goBack(); } @@ -365,7 +368,7 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: default: Navigation.dismissModal(); } - }, [achData, currentStep, isOffline, onfidoToken]); + }, [achData, currentStep, onfidoToken]); const isLoading = (isLoadingApp || (reimbursementAccount?.isLoading && !reimbursementAccount?.isCreateCorpayBankAccount)) && diff --git a/src/pages/ReimbursementAccount/USD/ConnectBankAccount/ConnectBankAccount.tsx b/src/pages/ReimbursementAccount/USD/ConnectBankAccount/ConnectBankAccount.tsx index fa9a3658531c..4702cb7339e3 100644 --- a/src/pages/ReimbursementAccount/USD/ConnectBankAccount/ConnectBankAccount.tsx +++ b/src/pages/ReimbursementAccount/USD/ConnectBankAccount/ConnectBankAccount.tsx @@ -30,7 +30,7 @@ function ConnectBankAccount({onBackButtonPress, setShouldShowConnectedVerifiedBa const {translate} = useLocalize(); const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {canBeMissing: true}); - const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${reimbursementAccount?.achData?.policyID}}`, {canBeMissing: true}); + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${reimbursementAccount?.achData?.policyID}`, {canBeMissing: true}); const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); const handleNavigateToConciergeChat = () => navigateToConciergeChat(true);