Merge pull request #275 from ArtemKolodko/fix_holders_count

Holders count update
pull/276/head
Artem 2 years ago committed by GitHub
commit cc87ca6ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/pages/AddressPage/index.tsx

@ -65,7 +65,7 @@ export function AddressPage() {
id = id.slice(0, 3) === "one" ? getAddress(id).basicHex : id; id = id.slice(0, 3) === "one" ? getAddress(id).basicHex : id;
const erc20Token = erc20Map[id] || null; const erc20Token = erc20Map[id] || null;
const erc1155Token = erc1155Map[id] || null
let type = erc721Map[id] let type = erc721Map[id]
? "erc721" ? "erc721"
: erc1155Map[id] : erc1155Map[id]
@ -192,7 +192,9 @@ export function AddressPage() {
} }
return acc return acc
}, {} as Record<string, boolean>) }, {} as Record<string, boolean>)
setHoldersCount(Object.keys(holdersMap).length) const holdersInventoryLength = Object.keys(holdersMap).length
const tokenHolders = erc1155Token ? erc1155Token.holders : 0
setHoldersCount(Math.max(holdersInventoryLength, +tokenHolders))
} }
} else { } else {
setInventory([]); setInventory([]);

Loading…
Cancel
Save