craft-nft

A standalone NFT implementation for real-world arts and crafts assets
Log | Files | Refs | README

commit 462a865ddaf639ac3361223c150abb729ef050a5
parent 18bbc3c6b226e8b1488348c2bf9a78fc85a0e17a
Author: lash <dev@holbrook.no>
Date:   Sat, 17 Dec 2022 21:33:47 +0000

Remove mint link when batch full

Diffstat:
Mjs/manual_test_browser.js | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/js/manual_test_browser.js b/js/manual_test_browser.js @@ -9,7 +9,7 @@ window.addEventListener('token', (e) => { }); -window.addEventListener('tokenBatch', (e) => { +window.addEventListener('tokenBatch', async (e) => { let currentTokenId = document.getElementById('token_id').innerHTML; if (currentTokenId.substring(0, 2) == '0x') { currentTokenId = currentTokenId.substring(2); @@ -20,9 +20,10 @@ window.addEventListener('tokenBatch', (e) => { const li = document.createElement('li'); const span = document.createElement('span'); li.setAttribute('id', 'token_' + e.detail.tokenId + ' _batch_' + e.detail.batch); - span.innerHTML = 'used ' + e.detail.cursor + ' of ' + e.detail.count; + span.innerHTML = 'used ' + e.detail.cursor + ' of ' + e.detail.count + ' '; li.appendChild(span); - if (window.craftnft.isMintAvailable(session, e.detail.tokenId, e.detail.batch)) { + const isMintable = await window.craftnft.isMintAvailable(session, e.detail.tokenId, e.detail.batch); + if (isMintable) { const a = document.createElement('a'); a.setAttribute('onClick', 'uiMintToken("' + e.detail.tokenId + '", ' + e.detail.batch + ')'); a.innerHTML = 'mint';