This commit is contained in:
Timothy Jaeryang Baek 2025-05-19 02:01:07 +04:00
parent 417ba4980a
commit c6580a2a02

View File

@ -33,15 +33,14 @@
clearTimeout(searchDebounceTimeout); clearTimeout(searchDebounceTimeout);
} }
page = 1;
chatList = null;
if (query === '') { if (query === '') {
page = 1;
chatList = await getChatList(localStorage.token, page); chatList = await getChatList(localStorage.token, page);
} else { } else {
searchDebounceTimeout = setTimeout(async () => { searchDebounceTimeout = setTimeout(async () => {
page = 1;
chatList = null;
chatList = await getChatListBySearchText(localStorage.token, query, page); chatList = await getChatListBySearchText(localStorage.token, query, page);
}, 100); }, 200);
} }
if ((chatList ?? []).length === 0) { if ((chatList ?? []).length === 0) {