@visualizevalue/mint-app-base 0.1.109 → 0.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/AppHeader.vue
CHANGED
|
@@ -154,11 +154,7 @@ export const useOnchainStore = () => {
|
|
|
154
154
|
args: [artist],
|
|
155
155
|
chainId,
|
|
156
156
|
})).map((a: `0x${string}`) => a.toLowerCase() as `0x${string}`)
|
|
157
|
-
|
|
158
|
-
if (this.artists[artist].collections.length === collectionAddresses.length) {
|
|
159
|
-
console.info(`Collections fetched already (${collectionAddresses.length} collections)`)
|
|
160
|
-
return
|
|
161
|
-
}
|
|
157
|
+
.filter((a: `0x${string}`) => !this.artists[artist].collections.includes(a))
|
|
162
158
|
|
|
163
159
|
try {
|
|
164
160
|
await Promise.all(collectionAddresses.map(address => this.fetchCollection(address)))
|
|
@@ -391,6 +387,14 @@ export const useOnchainStore = () => {
|
|
|
391
387
|
}
|
|
392
388
|
},
|
|
393
389
|
|
|
390
|
+
clearTokenBalance (token: Token) {
|
|
391
|
+
this.tokenBalances[token.collection] = {}
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
clearAllTokenBalances () {
|
|
395
|
+
this.tokenBalances = {}
|
|
396
|
+
},
|
|
397
|
+
|
|
394
398
|
async fetchTokenBalance (token: Token, address: `0x${string}`) {
|
|
395
399
|
const client = getPublicClient($wagmi, { chainId })
|
|
396
400
|
const mintContract = getContract({
|
|
@@ -400,7 +404,7 @@ export const useOnchainStore = () => {
|
|
|
400
404
|
})
|
|
401
405
|
|
|
402
406
|
if (! this.tokenBalances[token.collection]) {
|
|
403
|
-
this.
|
|
407
|
+
this.clearTokenBalance(token)
|
|
404
408
|
}
|
|
405
409
|
|
|
406
410
|
this.tokenBalances[token.collection][`${token.tokenId}`] =
|