From c6580a2a02b5a167e921ab4737d49364f22ad541 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 19 May 2025 02:01:07 +0400 Subject: [PATCH] refac --- src/lib/components/layout/SearchModal.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/components/layout/SearchModal.svelte b/src/lib/components/layout/SearchModal.svelte index 8730d5ce5..a5c41cb58 100644 --- a/src/lib/components/layout/SearchModal.svelte +++ b/src/lib/components/layout/SearchModal.svelte @@ -33,15 +33,14 @@ clearTimeout(searchDebounceTimeout); } + page = 1; + chatList = null; if (query === '') { - page = 1; chatList = await getChatList(localStorage.token, page); } else { searchDebounceTimeout = setTimeout(async () => { - page = 1; - chatList = null; chatList = await getChatListBySearchText(localStorage.token, query, page); - }, 100); + }, 200); } if ((chatList ?? []).length === 0) {