From 0f2d1af1ce2092b2d6021823a923ddd179682f52 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:25:39 -0400 Subject: [PATCH] fix: a search in Shared Chats or a user's Chats loads more than the first 60 results (#32675) --- .../components/admin/Users/UserList/UserChatsModal.svelte | 8 ++------ src/lib/components/layout/SharedChatsModal.svelte | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) 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 () => {