From 8330fcdb5c3366e192980e2f28749194868ca4f6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 19 Oct 2024 20:47:30 -0700 Subject: [PATCH] refac --- src/lib/components/layout/Sidebar.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);