Skip to content

Commit

Permalink
fix: remvoe hidden/scam nfts in collections
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeanribeiro committed May 25, 2024
1 parent 76f269e commit bc339f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export let collectionId: string
$: nfts = $ownedNfts.filter((nft) => nft.collectionId === collectionId)
$: nfts = $ownedNfts.filter((nft) => nft.collectionId === collectionId && !nft.hidden && !nft.isScam)
onDestroy(() => {
$selectedCollectionId = undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
$: collection = $persistedCollections[collectionId]
$: nfts = $ownedNfts.filter((nft) => nft.collectionId === collectionId)
$: nfts = $ownedNfts.filter((nft) => nft.collectionId === collectionId && !nft.hidden && !nft.isScam)
</script>

{#if collection && nfts.length > 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
let queriedCollectionsIds: string[] = []
$: collectionsIds = new Set(
$ownedNfts
?.map((nft) => nft.collectionId)
.filter((collectionId) => collectionId && $persistedCollections[collectionId])
)
$: collectionsIds = $ownedNfts?.reduce((set, nft) => {
if (!nft.hidden && !nft.isScam && nft.collectionId && $persistedCollections[nft.collectionId]) {
set.add(nft.collectionId)
}
return set
}, new Set<string>())
$: $collectionsSearchTerm, collectionsIds, setQueriedCollectionsIds()
function setQueriedCollectionsIds(): void {
queriedCollectionsIds = Array.from(collectionsIds)
.filter((collectionId) => isVisibleCollection($persistedCollections[collectionId]))
?.filter((collectionId) => isVisibleCollection($persistedCollections[collectionId]))
.sort((collectionId1, collectionId2) =>
$persistedCollections[collectionId1]?.name
.toLowerCase()
Expand Down

0 comments on commit bc339f9

Please sign in to comment.