Add loading store to Navigator to keep track of loading state

This commit is contained in:
2024-08-09 13:47:10 +02:00
parent 69744e41a6
commit 12e23b3872
11 changed files with 51 additions and 86 deletions

View File

@@ -32,8 +32,9 @@ const search = async (limit = 10) => {
error = ""
last_searched_term = search_term
last_limit = limit
searching = true
dispatch("loading", true)
nav.set_loading(true)
try {
search_results = await fs_search(nav.base.path, search_term, limit)
@@ -47,7 +48,7 @@ const search = async (limit = 10) => {
}
searching = false
dispatch("loading", false)
nav.set_loading(false)
// It's possible that the user entered another letter while we were
// performing the search reqeust. If this happens we run the search function