@visualizevalue/mint-app-base 0.1.13 → 0.1.14

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.
@@ -25,6 +25,7 @@
25
25
  <Actions v-if="step === 'chain'">
26
26
  <Button @click="cancel" class="secondary">Cancel</Button>
27
27
  </Actions>
28
+
28
29
  <Actions v-if="step === 'confirm' || step === 'error'">
29
30
  <Button @click="cancel" class="secondary">Cancel</Button>
30
31
  <Button @click="() => initializeRequest()">{{ text.action[step] || 'Execute' }}</Button>
@@ -34,7 +35,7 @@
34
35
 
35
36
  <script setup>
36
37
  import { useChainId } from '@wagmi/vue'
37
- import { waitForTransactionReceipt } from '@wagmi/core'
38
+ import { waitForTransactionReceipt, watchChainId } from '@wagmi/core'
38
39
  const checkChain = useEnsureChainIdCheck()
39
40
  const chainId = useChainId()
40
41
 
@@ -69,14 +70,16 @@ const emit = defineEmits(['complete', 'cancel'])
69
70
  const open = ref(false)
70
71
 
71
72
  const switchChain = ref(false)
72
- watch(chainId, async () => {
73
- if (! switchChain.value) return
73
+ watchChainId($wagmi, {
74
+ async onChange() {
75
+ if (! switchChain.value) return
74
76
 
75
- if (await checkChain()) {
76
- switchChain.value = false
77
- initializeRequest()
78
- } else {
79
- switchChain.value = true
77
+ if (await checkChain()) {
78
+ switchChain.value = false
79
+ initializeRequest()
80
+ } else {
81
+ switchChain.value = true
82
+ }
80
83
  }
81
84
  })
82
85
 
@@ -13,7 +13,7 @@ export const useEnsureChainIdCheck = () => {
13
13
 
14
14
  return async () => {
15
15
  if (chainId !== currentChainId.value) {
16
- await switchChain({ chainId })
16
+ switchChain({ chainId })
17
17
  }
18
18
 
19
19
  if (chainId === currentChainId.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {