Timothy Jaeryang Baek 5 months ago
parent
commit
c6580a2a02
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/lib/components/layout/SearchModal.svelte

+ 3 - 4
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) {