From 83597d2b1d8012a13a08cb9ef3e95fb3adb7411d Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sun, 24 Oct 2021 21:15:59 +0800 Subject: [PATCH] avoid triggering search again while updating location.hash --- src/App.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.svelte b/src/App.svelte index a313604..7ee9775 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -16,6 +16,7 @@ let need_update_title = false let sender let selected_init + let our_hash_change = false setContext('LUOXU_URL', LUOXU_URL) @@ -99,6 +100,7 @@ return } error = '' + our_hash_change = true console.log(`searching ${query} for group ${group}, older than ${more}, from ${sender}`) const q = new URLSearchParams() if(group) { @@ -138,6 +140,7 @@ error = e loading = false } + our_hash_change = false; } async function on_group_change() { @@ -156,7 +159,7 @@ } - + {if(!our_hash_change) do_hash_search()}}/>