From b8caf36ab65c87ef993c1810f009e7a15734258b Mon Sep 17 00:00:00 2001 From: tienifr Date: Sun, 25 Feb 2024 19:15:41 +0700 Subject: [PATCH] fix: selected icon not show for selected account --- src/pages/settings/Wallet/PaymentMethodList.tsx | 2 +- src/pages/settings/Wallet/TransferBalancePage.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Wallet/PaymentMethodList.tsx b/src/pages/settings/Wallet/PaymentMethodList.tsx index 019fe823e7b6..9193074f96c8 100644 --- a/src/pages/settings/Wallet/PaymentMethodList.tsx +++ b/src/pages/settings/Wallet/PaymentMethodList.tsx @@ -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} diff --git a/src/pages/settings/Wallet/TransferBalancePage.tsx b/src/pages/settings/Wallet/TransferBalancePage.tsx index 2d0a07340ab0..93ead17e9523 100644 --- a/src/pages/settings/Wallet/TransferBalancePage.tsx +++ b/src/pages/settings/Wallet/TransferBalancePage.tsx @@ -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; }