From 2485ab755d1a693bb6a65c93da19ff8da23a411d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 25 May 2024 11:43:48 +0200 Subject: [PATCH] feat: #7136 clean code --- src/components/common/VnSelect.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index b4f31799f..56293ebc5 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -165,10 +165,7 @@ async function fetchFilter(val) { async function filterHandler(val, update) { if (!$props.defaultFilter) return update(); - let newOptions; - if ($props.url && !isLoading.value) { - return; - } else newOptions = filter(val, myOptionsOriginal.value); + const newOptions = filter(val, myOptionsOriginal.value); update( () => { myOptions.value = newOptions; @@ -191,11 +188,9 @@ async function onScroll(scrollEv) { if (direction === 'decrease') return; if (to === lastIndex && arrayData.store.hasMoreData && !isLoading.value) { isLoading.value = true; - !$props.url && (await $props.fetchRef.paginate()); - $props.url && (await arrayData.loadMore()); + await arrayData.loadMore(); setOptions(arrayData.store.data); vnSelectRef.value.scrollTo(lastIndex); - isLoading.value = false; } }