mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-30 00:45:12 -05:00
refac
This commit is contained in:
1 parent
ed663f16ec
commit
b7489bbc6c
7 files changed
+91
-22
No files matched your search
@@ -123,6 +123,21 @@ export const setChatActive = (chatId: string, active: boolean): boolean => {
|
||||
return found;
|
||||
};
|
||||
|
||||
export const setChatReadAt = (chatId: string, lastReadAt: number): boolean => {
|
||||
let found = false;
|
||||
const updateChat = (chat: ChatListItem) => {
|
||||
if (chat.id !== chatId) {
|
||||
return chat;
|
||||
}
|
||||
found = true;
|
||||
return { ...chat, last_read_at: lastReadAt };
|
||||
};
|
||||
|
||||
chatsStore.update((items) => (items ? items.map(updateChat) : items));
|
||||
pinnedChatsStore.update((items) => items.map(updateChat));
|
||||
return found;
|
||||
};
|
||||
|
||||
export const resetChatListState = () => {
|
||||
requestGeneration += 1;
|
||||
currentPage = 1;
|
||||
|
||||
Reference in new issue
Block a user