Skip to content

Commit

Permalink
using balance to check token ownership, rather than ids
Browse files Browse the repository at this point in the history
  • Loading branch information
bearni95 committed Jun 3, 2024
1 parent 2d19974 commit 85fd514
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/taikoon-ui/src/components/Mint/Mint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
}
const address = $account.address as IAddress;
mintedTokenIds = await Token.tokenOfOwner(address);
hasAlreadyMinted = mintedTokenIds.length > 0;
const balance = await Token.balanceOf(address);
hasAlreadyMinted = balance > 0;
if (!hasAlreadyMinted) {
canMint = await Token.canMint();
Expand All @@ -108,7 +108,6 @@
}
$: $account, load();
$: mintedTokenIds = [] as number[];
$: hasAlreadyMinted = false;
async function mint() {
Expand Down

0 comments on commit 85fd514

Please sign in to comment.