Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/KYCWall/BaseKYCWall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ function KYCWall({

const invoiceReceiverPolicyID = getInvoiceReceiverPolicyID(chatReport);
const invoiceReceiverPolicy = invoiceReceiverPolicyID ? policies?.[`${ONYXKEYS.COLLECTION.POLICY}${invoiceReceiverPolicyID}`] : undefined;
const bankAccountRoute = addBankAccountRoute ?? getBankAccountRoute(chatReport, invoiceReceiverPolicy?.areInvoicesEnabled);
const resolvedAddBankAccountRoute = typeof addBankAccountRoute === 'function' ? addBankAccountRoute() : addBankAccountRoute;
const bankAccountRoute = resolvedAddBankAccountRoute ?? getBankAccountRoute(chatReport, invoiceReceiverPolicy?.areInvoicesEnabled);
Navigation.navigate(bankAccountRoute);
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/KYCWall/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type ContinueActionParams = {
};

type KYCWallProps = {
/** Route for the Add Bank Account screen for a given navigation stack */
addBankAccountRoute?: Route;
/** Route for the Add Bank Account screen for a given navigation stack. Pass a function to defer building the route (e.g. its backTo) until the moment of the press. */
addBankAccountRoute?: Route | (() => Route | undefined);

/** Route for the Add Debit Card screen for a given navigation stack */
addDebitCardRoute?: Route;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Search/SearchBulkActionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
iouReport={selectedIOUReport}
addBankAccountRoute={
isCurrentSelectedExpenseReport ? ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: currentSelectedPolicyID, backTo: Navigation.getActiveRoute()}) : undefined
isCurrentSelectedExpenseReport
? () => ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: currentSelectedPolicyID, backTo: Navigation.getActiveRoute()})
: undefined
}
onSuccessfulKYC={(paymentType) => {
confirmPayment?.(paymentType, pendingPaymentAdditionalDataRef.current);
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ function SettlementButton({
isDisabled={isOffline}
source={CONST.KYC_WALL_SOURCE.REPORT}
chatReportID={chatReportID}
addBankAccountRoute={isExpenseReport ? ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: iouReport?.policyID, backTo: Navigation.getActiveRoute()}) : undefined}
addBankAccountRoute={isExpenseReport ? () => ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: iouReport?.policyID, backTo: Navigation.getActiveRoute()}) : undefined}
Comment thread
mountiny marked this conversation as resolved.
iouReport={iouReport}
policy={lastPaymentPolicy}
anchorAlignment={kycWallAnchorAlignment}
Expand Down
Loading