Remove useFetch

This commit is contained in:
Adria Navarro 2023-09-22 15:50:29 +02:00
parent c814e51e36
commit 160b52c22b
5 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,6 @@
export let sort = false
export let autoWidth = false
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
export let customPopoverOffsetBelow
export let customPopoverMaxHeight
@ -94,7 +93,6 @@
{autocomplete}
bind:searchTerm
bind:open
{useFetch}
{isOptionSelected}
{getOptionLabel}
{getOptionValue}

View File

@ -37,7 +37,6 @@
export let autocomplete = false
export let sort = false
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
export let customPopoverOffsetBelow
export let customPopoverMaxHeight
@ -85,7 +84,7 @@
}
const getFilteredOptions = (options, term, getLabel) => {
if (autocomplete && term && !useFetch) {
if (autocomplete && term) {
const lowerCaseTerm = term.toLowerCase()
return options.filter(option => {
return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)

View File

@ -17,7 +17,6 @@
export let autoWidth = false
export let autocomplete = false
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
const dispatch = createEventDispatcher()
@ -42,7 +41,6 @@
{autocomplete}
{customPopoverHeight}
bind:searchTerm
{useFetch}
on:change={onChange}
on:click
/>

View File

@ -86,8 +86,15 @@
$: userPage = $userPageInfo.page
$: logsPage = $logsPageInfo.page
$: userList = {
...(userList || {}),
...$users.data?.reduce((p, c) => {
p[c._id] = c
return p
}, {}),
}
$: sortedUsers = sort(
enrich($users.data || [], selectedUsers, "_id"),
enrich(Object.values(userList), selectedUsers, "_id"),
"email"
)
$: sortedEvents = sort(
@ -257,7 +264,6 @@
<div class="select">
<Multiselect
bind:searchTerm={userSearchTerm}
useFetch
placeholder="All users"
label="Users"
autocomplete

View File

@ -152,7 +152,6 @@
getOptionValue={option => option._id}
{placeholder}
sort
useFetch={false}
bind:searchTerm
loading={$fetch.loading}
/>