feat: #7136 clean code
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-05-25 11:43:48 +02:00
parent 2361042fac
commit 2485ab755d
1 changed files with 2 additions and 7 deletions

View File

@ -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;
}
}