Filter cards owned by existing minters

This commit is contained in:
QuickMythril 2024-12-30 02:41:03 -05:00
parent 3ccaa50e09
commit 6a674c1592

View File

@ -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) => {