Skip to content

Commit

Permalink
fix: selected icon not show for selected account
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Feb 25, 2024
1 parent befbda6 commit b8caf36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/settings/Wallet/PaymentMethodList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function PaymentMethodList({
hoverAndPressStyle={styles.hoveredComponentBG}
shouldShowRightIcon={item.shouldShowRightIcon}
shouldShowSelectedState={shouldShowSelectedState}
isSelected={selectedMethodID === item.methodID}
isSelected={selectedMethodID.toString() === item.methodID?.toString()}
interactive={item.interactive}
brickRoadIndicator={item.brickRoadIndicator}
success={item.isMethodActive}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/settings/Wallet/TransferBalancePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ function TransferBalancePage({bankAccountList, fundList, userWallet, walletTrans
const paymentMethods = PaymentUtils.formatPaymentMethods(bankAccountList ?? {}, paymentCardList, styles);

const defaultAccount = paymentMethods.find((method) => method.isDefault);
const selectedAccount = paymentMethods.find((method) => method.accountType === walletTransfer?.selectedAccountType && method.methodID === walletTransfer?.selectedAccountID);
const selectedAccount = paymentMethods.find(
(method) => method.accountType === walletTransfer?.selectedAccountType && method.methodID?.toString() === walletTransfer?.selectedAccountID?.toString(),
);
return selectedAccount ?? defaultAccount;
}

Expand Down

0 comments on commit b8caf36

Please sign in to comment.