Skip to content

Commit 9f61364

Browse files
authored
fix: hydratation mismatches (#835)
1 parent 6453188 commit 9f61364

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

components/ContactPointSelect.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const props = defineProps<{
160160
161161
const { t } = useTranslation()
162162
const { $api } = useNuxtApp()
163-
const { isLoading, start, finish } = useLoadingIndicator()
163+
const isLoading = ref(false)
164164
165165
const contactSelectRef = useTemplateRef('contactSelect')
166166
@@ -232,7 +232,7 @@ async function save() {
232232
console.error('[ContactPointSelect] Cannot save: contact already has an id, expected a new contact')
233233
return
234234
}
235-
start()
235+
isLoading.value = true
236236
try {
237237
const newContact = await newContactPoint($api, props.organization, contact.value)
238238
if (contactSelectRef.value) {
@@ -241,7 +241,7 @@ async function save() {
241241
}
242242
}
243243
finally {
244-
finish()
244+
isLoading.value = false
245245
}
246246
}
247247
</script>

components/Datasets/AdminUpdateDatasetPage.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const { t } = useTranslation()
142142
const { $api } = useNuxtApp()
143143
144144
const route = useRoute()
145-
const { start, finish, isLoading } = useLoadingIndicator()
145+
const isLoading = ref(false)
146146
147147
const url = computed(() => `/api/2/datasets/${route.params.id}/`)
148148
const { data: dataset, status, refresh } = await useAPI<DatasetV2WithFullObject>(url, {
@@ -165,7 +165,7 @@ async function save() {
165165
if (!datasetForm.value) throw new Error('No dataset form')
166166
167167
try {
168-
start()
168+
isLoading.value = true
169169
if (
170170
datasetForm.value.contact_points
171171
&& datasetForm.value.owned?.organization
@@ -187,12 +187,12 @@ async function save() {
187187
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
188188
}
189189
finally {
190-
finish()
190+
isLoading.value = false
191191
}
192192
}
193193
194194
async function deleteDataset() {
195-
start()
195+
isLoading.value = true
196196
try {
197197
await $api(`/api/1/datasets/${route.params.id}`, {
198198
method: 'DELETE',
@@ -202,13 +202,13 @@ async function deleteDataset() {
202202
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
203203
}
204204
finally {
205-
finish()
205+
isLoading.value = false
206206
}
207207
}
208208
209209
async function switchDatasetPrivate() {
210210
if (!datasetForm.value) throw new Error('No dataset form')
211-
start()
211+
isLoading.value = true
212212
try {
213213
await $api(`/api/1/datasets/${dataset.value?.id}/`, {
214214
method: 'PUT',
@@ -223,13 +223,13 @@ async function switchDatasetPrivate() {
223223
}
224224
}
225225
finally {
226-
finish()
226+
isLoading.value = false
227227
}
228228
}
229229
230230
async function restoreDataset() {
231231
if (!datasetForm.value) throw new Error('No dataset form')
232-
start()
232+
isLoading.value = true
233233
try {
234234
await $api(`/api/1/datasets/${dataset.value?.id}/`, {
235235
method: 'PUT',
@@ -239,13 +239,13 @@ async function restoreDataset() {
239239
toast.success(t('Jeu de données restauré !'))
240240
}
241241
finally {
242-
finish()
242+
isLoading.value = false
243243
}
244244
}
245245
246246
async function archiveDataset() {
247247
if (!datasetForm.value) throw new Error('No dataset form')
248-
start()
248+
isLoading.value = true
249249
try {
250250
await $api(`/api/1/datasets/${dataset.value?.id}/`, {
251251
method: 'PUT',
@@ -261,14 +261,14 @@ async function archiveDataset() {
261261
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
262262
}
263263
finally {
264-
finish()
264+
isLoading.value = false
265265
}
266266
}
267267
268268
async function feature() {
269269
const method = dataset.value?.featured ? 'DELETE' : 'POST'
270270
try {
271-
start()
271+
isLoading.value = true
272272
await $api(`/api/1/datasets/${route.params.id}/featured`, {
273273
method,
274274
})
@@ -284,7 +284,7 @@ async function feature() {
284284
toast.error(t('Impossible de mettre en avant ce jeu de données'))
285285
}
286286
finally {
287-
finish()
287+
isLoading.value = false
288288
}
289289
}
290290
</script>

0 commit comments

Comments
 (0)