@visualizevalue/mint-app-base 0.1.122 → 0.1.123

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.
@@ -4,6 +4,7 @@
4
4
  <FormInput
5
5
  type="number"
6
6
  v-model="mintCount"
7
+ @input="userEdited = true"
7
8
  min="1"
8
9
  step="1"
9
10
  required
@@ -45,7 +46,14 @@ const props = defineProps({
45
46
  })
46
47
 
47
48
  const mintCount = defineModel('mintCount', { default: '1' })
49
+ const userEdited = ref(false)
50
+
51
+ watch(() => props.defaultAmount, (v) => {
52
+ if (! userEdited.value) mintCount.value = String(v)
53
+ }, { immediate: true })
54
+
48
55
  const onMinted = () => {
56
+ userEdited.value = false
49
57
  mintCount.value = String(props.defaultAmount)
50
58
  props.minted()
51
59
  }
@@ -28,7 +28,5 @@ export const useMintDefault = () => {
28
28
  // Persist across navigations so the value survives remounts
29
29
  const mintCount = useState('mint-count', () => String(defaultAmount.value))
30
30
 
31
- watch(defaultAmount, (v) => { mintCount.value = String(v) })
32
-
33
31
  return { defaultAmount, mintCount }
34
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.122",
3
+ "version": "0.1.123",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {