Skip to content

Commit

Permalink
fix: Show collections for minters (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Dec 11, 2024
1 parent 404f8d5 commit ff7cdb8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Collection/Collection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,20 +625,23 @@ export class CollectionService {
if (remoteCollections.length > 0) {
// Create a map of remote collections for fast lookup
const remoteCollectionMap = Object.fromEntries(
remoteCollections.map(({ id, creator, managers }) => [
remoteCollections.map(({ id, creator, managers, minters }) => [
id,
{ creator, managers },
{ creator, managers, minters },
])
)

// If exists the remote collection, filter by the creator field or the managers field
// If exists the remote collection, filter by the creator field or the managers field or the minters field
allCollections = allCollections.filter(
({ contract_address }) =>
!remoteCollectionMap[contract_address!] ||
remoteCollectionMap[contract_address!].creator ===
params.address! ||
remoteCollectionMap[contract_address!].managers.includes(
params.address!
) ||
remoteCollectionMap[contract_address!].minters.includes(
params.address!
)
)
}
Expand Down

0 comments on commit ff7cdb8

Please sign in to comment.