mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
fix: archived chats
This commit is contained in:
parent
466eea1a4c
commit
0b2c7046cd
@ -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]
|
||||
|
@ -311,6 +311,7 @@
|
||||
<ArchivedChatsModal
|
||||
bind:show={$showArchivedChats}
|
||||
on:change={async () => {
|
||||
await pinnedChats.set(await getPinnedChatList(localStorage.token));
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user