Skip to content

Commit

Permalink
fix: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
koko57 committed Aug 12, 2024
1 parent ee65625 commit b76ab11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ function startIssueNewCardFlow(policyID: string) {
API.read(READ_COMMANDS.START_ISSUE_NEW_CARD_FLOW, parameters);
}

function configureExpensifyCardsForPolicy(policyID: string, bankAccountID: number) {
function configureExpensifyCardsForPolicy(policyID: string, bankAccountID?: number) {
if (!bankAccountID) {
return;
}

const parameters = {
policyID,
bankAccountID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function WorkspaceExpensifyCardBankAccounts({route}: WorkspaceExpensifyCardBankA
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute('new', policyID, ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID)));
};

const handleSelectBankAccount = (value: number) => {
const handleSelectBankAccount = (value?: number) => {
Card.configureExpensifyCardsForPolicy(policyID, value);
Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID));
};
Expand All @@ -49,7 +49,7 @@ function WorkspaceExpensifyCardBankAccounts({route}: WorkspaceExpensifyCardBankA
return eligibleBankAccounts.map((bankAccount) => {
const bankName = (bankAccount.accountData?.addressName ?? '') as BankName;
const bankAccountNumber = bankAccount.accountData?.accountNumber ?? '';
const bankAccountID = bankAccount.accountData?.bankAccountID ?? 0;
const bankAccountID = bankAccount.accountData?.bankAccountID;

const {icon, iconSize, iconStyles} = getBankIcon({bankName, styles});

Expand Down

0 comments on commit b76ab11

Please sign in to comment.