From 0b2c7046cd78b20694df80925a7a07d5325c693a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 14 Oct 2024 15:29:43 -0700 Subject: [PATCH] fix: archived chats --- backend/open_webui/apps/webui/models/chats.py | 4 +++- src/lib/components/layout/Sidebar.svelte | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/apps/webui/models/chats.py b/backend/open_webui/apps/webui/models/chats.py index 509dff9fe..213872371 100644 --- a/backend/open_webui/apps/webui/models/chats.py +++ b/backend/open_webui/apps/webui/models/chats.py @@ -61,10 +61,12 @@ class ChatModel(BaseModel): class ChatForm(BaseModel): chat: dict + class ChatTitleMessagesForm(BaseModel): title: str messages: list[dict] + class ChatTitleForm(BaseModel): title: str @@ -361,7 +363,7 @@ class ChatTable: with get_db() as db: all_chats = ( db.query(Chat) - .filter_by(user_id=user_id, pinned=True) + .filter_by(user_id=user_id, pinned=True, archived=False) .order_by(Chat.updated_at.desc()) ) return [ChatModel.model_validate(chat) for chat in all_chats] diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index ed7107c6f..4ac597bd2 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -311,6 +311,7 @@ { + await pinnedChats.set(await getPinnedChatList(localStorage.token)); await chats.set(await getChatList(localStorage.token)); }} />