Filter cards owned by existing minters
This commit is contained in:
parent
3ccaa50e09
commit
6a674c1592
@ -245,7 +245,18 @@ const loadCards = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const finalCards = await processMinterCards(validCards)
|
||||
// Filter out cards owned by addresses already in the Minter group.
|
||||
const minterGroupData = await fetchMinterGroupMembers();
|
||||
const minterGroupAddresses = minterGroupData.map(m => m.member);
|
||||
const notInMinterGroupCards = validCards.filter(
|
||||
(card) => !minterGroupAddresses.includes(card.address)
|
||||
);
|
||||
|
||||
if (notInMinterGroupCards.length === 0) {
|
||||
cardsContainer.innerHTML = "<p>No cards to display. (All belong to existing Minters.)</p>";
|
||||
return;
|
||||
}
|
||||
const finalCards = await processMinterCards(notInMinterGroupCards);
|
||||
|
||||
// Sort cards by timestamp descending (newest first)
|
||||
// validCards.sort((a, b) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user