From 245d0eed06aaf54e554c2561ce57a62118ac48e0 Mon Sep 17 00:00:00 2001 From: Charles Bachmeier Date: Wed, 8 Nov 2023 09:21:14 -0800 Subject: [PATCH] fix: hide invalid nft collections with 0 items from search bar (#7547) fix: hide invalid collecitons with 0 items --- src/graphql/data/nft/CollectionSearch.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphql/data/nft/CollectionSearch.ts b/src/graphql/data/nft/CollectionSearch.ts index b33a4c5a46..c867e9a86b 100644 --- a/src/graphql/data/nft/CollectionSearch.ts +++ b/src/graphql/data/nft/CollectionSearch.ts @@ -82,9 +82,11 @@ export function useCollectionSearch(queryOrAddress: string): useCollectionSearch const isName = !isAddress(queryOrAddress.toLowerCase()) const queryResult = useCollectionQuerySearch(queryOrAddress, /* skip= */ !isName) const addressResult = useCollection(queryOrAddress, /* skip= */ isName) + const invalidCollectionAddress = + blocklistedCollections.includes(queryOrAddress) || !addressResult.data.stats?.total_supply return isName ? queryResult - : blocklistedCollections.includes(queryOrAddress) + : invalidCollectionAddress ? { data: [], loading: false } : { data: [addressResult.data], loading: addressResult.loading } }