Skip to content

Commit 465b765

Browse files
authored
Merge pull request Expensify#69150 from samranahm/65828/fix-addCardButton-display
[No QA] fix: Add selector function on fundList to have only p2p cards in wallet page
2 parents 8b976e1 + d8f5f60 commit 465b765

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
@@ -60,7 +60,10 @@ type WalletPageProps = {
6060
function WalletPage({shouldListenForResize = false}: WalletPageProps) {
6161
const [bankAccountList = getEmptyObject<OnyxTypes.BankAccountList>()] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true});
6262
const [cardList = getEmptyObject<OnyxTypes.CardList>()] = useOnyx(ONYXKEYS.CARD_LIST, {canBeMissing: true});
63-
const [fundList = getEmptyObject<OnyxTypes.FundList>()] = useOnyx(ONYXKEYS.FUND_LIST, {canBeMissing: true});
63+
const [fundList = getEmptyObject<OnyxTypes.FundList>()] = useOnyx(ONYXKEYS.FUND_LIST, {
64+
canBeMissing: true,
65+
selector: (allFunds) => Object.fromEntries(Object.entries(allFunds ?? {}).filter(([, item]) => item.accountData?.additionalData?.isP2PDebitCard === true)),
66+
});
6467
const [isLoadingPaymentMethods = true] = useOnyx(ONYXKEYS.IS_LOADING_PAYMENT_METHODS, {canBeMissing: true});
6568
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: true});
6669
const [walletTerms = getEmptyObject<OnyxTypes.WalletTerms>()] = useOnyx(ONYXKEYS.WALLET_TERMS, {canBeMissing: true});

0 commit comments

Comments
 (0)