Skip to content

Commit

Permalink
remove redundant parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
getusha committed Oct 18, 2023
1 parent 5f78a22 commit 5d73a1f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/SettlementButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/BankAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/types/onyx/PersonalBankAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 5d73a1f

Please sign in to comment.