diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 0d3a45c0e..1bd4632c9 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -151,7 +151,12 @@ currentChatPage.set(1); allChatsLoaded = false; - await chats.set(await getChatList(localStorage.token, $currentChatPage)); + + if (search) { + await chats.set(await getChatListBySearchText(localStorage.token, search, $currentChatPage)); + } else { + await chats.set(await getChatList(localStorage.token, $currentChatPage)); + } // Enable pagination scrollPaginationEnabled.set(true);