mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-05 00:19:59 +00:00
refactor: improve search UX
This commit is contained in:
parent
2b5badf235
commit
0bf76fdf86
1 changed files with 7 additions and 1 deletions
|
@ -56,6 +56,12 @@ export function useSearch(query: MaybeRef<string>, options?: UseSearchOptions) {
|
|||
}))]
|
||||
}
|
||||
|
||||
watch(() => unref(query), () => {
|
||||
if (!unref(query) || !isMastoInitialised.value)
|
||||
return
|
||||
loading.value = true
|
||||
})
|
||||
|
||||
debouncedWatch(() => unref(query), async () => {
|
||||
if (!unref(query) || !isMastoInitialised.value)
|
||||
return
|
||||
|
@ -78,7 +84,7 @@ export function useSearch(query: MaybeRef<string>, options?: UseSearchOptions) {
|
|||
appendResults(nextResults.value, true)
|
||||
|
||||
loading.value = false
|
||||
}, { debounce: 500 })
|
||||
}, { debounce: 300 })
|
||||
|
||||
const next = async () => {
|
||||
if (!unref(query) || !isMastoInitialised.value || !paginator)
|
||||
|
|
Loading…
Reference in a new issue