From ecfdf0b6b9b9cd52d9aac61321926050c6bf8fd3 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 14 Aug 2024 15:27:36 +0200 Subject: [PATCH] fix: refs #6900 improve loading --- src/components/ui/VnFilterPanel.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 4fd511631..ab4e2e0da 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -117,14 +117,17 @@ async function search(evt) { isLoading.value = true; const filter = { ...userParams.value, ...$props.modelValue }; store.userParamsChanged = true; - const { params: newParams } = await arrayData.addFilter({ - params: filter, - }); - userParams.value = newParams; + try { + const { params: newParams } = await arrayData.addFilter({ + params: filter, + }); + userParams.value = newParams; - if (!$props.showAll && !Object.values(filter).length) store.data = []; + if (!$props.showAll && !Object.values(filter).length) store.data = []; + } finally { + isLoading.value = false; + } - isLoading.value = false; emit('search'); }