@1001-digital/components 1.1.2 → 1.1.4
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/package.json
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
:duration="duration"
|
|
4
4
|
:swipe-direction="swipeDirection"
|
|
5
5
|
>
|
|
6
|
-
<slot />
|
|
7
|
-
|
|
8
6
|
<ToastRoot
|
|
9
7
|
v-for="toast in toasts"
|
|
10
8
|
:key="toast.id"
|
|
@@ -73,6 +71,7 @@
|
|
|
73
71
|
:class="[position]"
|
|
74
72
|
/>
|
|
75
73
|
</ToastProvider>
|
|
74
|
+
|
|
76
75
|
</template>
|
|
77
76
|
|
|
78
77
|
<script setup lang="ts">
|
|
@@ -62,33 +62,39 @@ function useEnsBase(
|
|
|
62
62
|
const data: Ref<EnsProfile | null | undefined> = ref(
|
|
63
63
|
ensCache.get(cacheKey.value) ?? undefined,
|
|
64
64
|
)
|
|
65
|
+
const pending = ref(false)
|
|
65
66
|
|
|
66
67
|
watchEffect(async () => {
|
|
67
68
|
const id = toValue(identifier)
|
|
68
69
|
if (!id) {
|
|
69
70
|
data.value = null
|
|
71
|
+
pending.value = false
|
|
70
72
|
return
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
const cached = ensCache.get(cacheKey.value)
|
|
74
76
|
if (cached) {
|
|
75
77
|
data.value = cached
|
|
78
|
+
pending.value = false
|
|
76
79
|
return
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
const strategies: EnsMode[] =
|
|
80
83
|
mode.value === 'indexer' ? ['indexer', 'chain'] : ['chain', 'indexer']
|
|
81
84
|
|
|
85
|
+
pending.value = true
|
|
82
86
|
try {
|
|
83
87
|
data.value = await ensCache.fetch(cacheKey.value, () =>
|
|
84
88
|
resolve(id, strategies, indexerUrls.value, config, chainKeys),
|
|
85
89
|
)
|
|
86
90
|
} catch {
|
|
87
91
|
data.value = null
|
|
92
|
+
} finally {
|
|
93
|
+
pending.value = false
|
|
88
94
|
}
|
|
89
95
|
})
|
|
90
96
|
|
|
91
|
-
return { data }
|
|
97
|
+
return { data, pending }
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
export const useEns = (
|