diff --git a/src/lib/components/admin/Users/UserList/UserChatsModal.svelte b/src/lib/components/admin/Users/UserList/UserChatsModal.svelte index f19ae60c39..2623385446 100644 --- a/src/lib/components/admin/Users/UserList/UserChatsModal.svelte +++ b/src/lib/components/admin/Users/UserList/UserChatsModal.svelte @@ -56,17 +56,13 @@ if (query === '') { chatList = await getChatListByUserId(localStorage.token, user.id, page, filter); + allChatsLoaded = (chatList ?? []).length === 0; } else { searchDebounceTimeout = setTimeout(async () => { chatList = await getChatListByUserId(localStorage.token, user.id, page, filter); + allChatsLoaded = (chatList ?? []).length === 0; }, 500); } - - if ((chatList ?? []).length === 0) { - allChatsLoaded = true; - } else { - allChatsLoaded = false; - } }; const loadMoreChats = async () => { diff --git a/src/lib/components/layout/SharedChatsModal.svelte b/src/lib/components/layout/SharedChatsModal.svelte index 9fbdeb17a8..54bdb9df3e 100644 --- a/src/lib/components/layout/SharedChatsModal.svelte +++ b/src/lib/components/layout/SharedChatsModal.svelte @@ -52,17 +52,13 @@ if (query === '') { chatList = await getSharedChatList(localStorage.token, page, filter); + allChatsLoaded = (chatList ?? []).length === 0; } else { searchDebounceTimeout = setTimeout(async () => { chatList = await getSharedChatList(localStorage.token, page, filter); + allChatsLoaded = (chatList ?? []).length === 0; }, 500); } - - if ((chatList ?? []).length === 0) { - allChatsLoaded = true; - } else { - allChatsLoaded = false; - } }; const loadMoreChats = async () => {