Skip to content

Commit cb7726e

Browse files
committed
fix: Add selector function to have only p2p cards in wallet page
1 parent 9256c0a commit cb7726e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/pages/settings/Wallet/WalletPage/WalletPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ type WalletPageProps = {
5959
function WalletPage({shouldListenForResize = false}: WalletPageProps) {
6060
const [bankAccountList = getEmptyObject<OnyxTypes.BankAccountList>()] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true});
6161
const [cardList = getEmptyObject<OnyxTypes.CardList>()] = useOnyx(ONYXKEYS.CARD_LIST, {canBeMissing: true});
62-
const [fundList = getEmptyObject<OnyxTypes.FundList>()] = useOnyx(ONYXKEYS.FUND_LIST, {canBeMissing: true});
62+
const [fundList = getEmptyObject<OnyxTypes.FundList>()] = useOnyx(ONYXKEYS.FUND_LIST, {
63+
canBeMissing: true,
64+
selector: (fundList) => Object.fromEntries(Object.entries(fundList ?? {}).filter(([, item]) => item.accountData?.additionalData?.isP2PDebitCard === true)),
65+
});
6366
const [isLoadingPaymentMethods = true] = useOnyx(ONYXKEYS.IS_LOADING_PAYMENT_METHODS, {canBeMissing: true});
6467
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: true});
6568
const [walletTerms = getEmptyObject<OnyxTypes.WalletTerms>()] = useOnyx(ONYXKEYS.WALLET_TERMS, {canBeMissing: true});

0 commit comments

Comments
 (0)