diff --git a/src/components/SettlementButton.js b/src/components/SettlementButton.js index 4debe2355197..67673d664ac3 100644 --- a/src/components/SettlementButton.js +++ b/src/components/SettlementButton.js @@ -193,7 +193,7 @@ function SettlementButton({ const selectPaymentType = (event, iouPaymentType, triggerKYCFlow) => { if (iouPaymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || iouPaymentType === CONST.IOU.PAYMENT_TYPE.VBBA) { triggerKYCFlow(event, iouPaymentType); - BankAccounts.setPersonalBankAccountContinueKYCOnSuccess(true, ROUTES.ENABLE_PAYMENTS); + BankAccounts.setPersonalBankAccountContinueKYCOnSuccess(ROUTES.ENABLE_PAYMENTS); return; } diff --git a/src/libs/actions/BankAccounts.ts b/src/libs/actions/BankAccounts.ts index d3abd73142bd..a0d035292773 100644 --- a/src/libs/actions/BankAccounts.ts +++ b/src/libs/actions/BankAccounts.ts @@ -58,8 +58,8 @@ function openPersonalBankAccountSetupView(exitReportID: string) { /** * Whether after adding a bank account we should continue with the KYC flow */ -function setPersonalBankAccountContinueKYCOnSuccess(shouldContinueKYCOnSuccess: boolean, onSuccessFallbackRoute: string) { - Onyx.merge(ONYXKEYS.PERSONAL_BANK_ACCOUNT, {shouldContinueKYCOnSuccess, onSuccessFallbackRoute}); +function setPersonalBankAccountContinueKYCOnSuccess(onSuccessFallbackRoute: string) { + Onyx.merge(ONYXKEYS.PERSONAL_BANK_ACCOUNT, {onSuccessFallbackRoute}); } function clearPersonalBankAccount() { diff --git a/src/pages/AddPersonalBankAccountPage.js b/src/pages/AddPersonalBankAccountPage.js index b492e10f3e35..a560a467bc7b 100644 --- a/src/pages/AddPersonalBankAccountPage.js +++ b/src/pages/AddPersonalBankAccountPage.js @@ -89,12 +89,11 @@ class AddPersonalBankAccountPage extends React.Component { exitFlow(shouldContinue = false) { const exitReportID = lodashGet(this.props, 'personalBankAccount.exitReportID'); - const shouldContinueKYCOnSuccess = lodashGet(this.props, 'personalBankAccount.shouldContinueKYCOnSuccess', false); const onSuccessFallbackRoute = lodashGet(this.props, 'personalBankAccount.onSuccessFallbackRoute', ''); if (exitReportID) { Navigation.dismissModal(exitReportID); - } else if (shouldContinue && onSuccessFallbackRoute && shouldContinueKYCOnSuccess) { + } else if (shouldContinue && onSuccessFallbackRoute) { PaymentMethods.continueSetup(onSuccessFallbackRoute); } else { Navigation.goBack(ROUTES.SETTINGS_WALLET); diff --git a/src/types/onyx/PersonalBankAccount.ts b/src/types/onyx/PersonalBankAccount.ts index 14fdcce10bba..14b0f8cedecd 100644 --- a/src/types/onyx/PersonalBankAccount.ts +++ b/src/types/onyx/PersonalBankAccount.ts @@ -16,10 +16,7 @@ type PersonalBankAccount = { /** Any reportID we should redirect to at the end of the flow */ exitReportID?: string; - /** Whether the flow should continue to kyc on success */ - shouldContinueKYCOnSuccess?: boolean; - - /** The route to navigate to onSuccess */ + /** The route to redirect after adding PBA successfully */ onSuccessFallbackRoute?: string; };