refactor: improve search UX
parent
2b5badf235
commit
0bf76fdf86
|
@ -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 () => {
|
debouncedWatch(() => unref(query), async () => {
|
||||||
if (!unref(query) || !isMastoInitialised.value)
|
if (!unref(query) || !isMastoInitialised.value)
|
||||||
return
|
return
|
||||||
|
@ -78,7 +84,7 @@ export function useSearch(query: MaybeRef<string>, options?: UseSearchOptions) {
|
||||||
appendResults(nextResults.value, true)
|
appendResults(nextResults.value, true)
|
||||||
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}, { debounce: 500 })
|
}, { debounce: 300 })
|
||||||
|
|
||||||
const next = async () => {
|
const next = async () => {
|
||||||
if (!unref(query) || !isMastoInitialised.value || !paginator)
|
if (!unref(query) || !isMastoInitialised.value || !paginator)
|
||||||
|
|
Loading…
Reference in New Issue