@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.
@@ -39,6 +39,12 @@ const breadcrumbs = computed(() => {
39
39
 
40
40
  return all
41
41
  })
42
+
43
+ watchEffect(() => {
44
+ if (! isConnected.value) {
45
+ store.clearAllTokenBalances()
46
+ }
47
+ })
42
48
  </script>
43
49
 
44
50
  <style scoped>
@@ -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.tokenBalances[token.collection] = {}
407
+ this.clearTokenBalance(token)
404
408
  }
405
409
 
406
410
  this.tokenBalances[token.collection][`${token.tokenId}`] =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.109",
3
+ "version": "0.1.111",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {