mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-27 23:59:20 -05:00
fix: opening a chat in another tab sends a folder's chat list back to page 1 (#34145)
When a folder's chat list was open on a later page, opening any chat in another tab jumped that list back to page 1. Every time a chat was marked as read, all open tabs of the account reloaded the folder's chat list from the first page. Now the folder's chat list only clears the unread marker when a chat is marked as read, so it stays on the page you were on. Fixes #34142
This commit is contained in:
1 parent
29b4af6b98
commit
3e46a5a349
1 file changed
+5
-2
@@ -115,14 +115,17 @@
|
||||
|
||||
const chatEventHandler = (event: {
|
||||
chat_id?: string;
|
||||
data?: { type?: string; data?: { active?: boolean } };
|
||||
data?: { type?: string; data?: { active?: boolean; last_read_at?: number } };
|
||||
}) => {
|
||||
if (event.data?.type === 'chat:active' && event.chat_id) {
|
||||
const active = event.data.data?.active ?? false;
|
||||
if (!updateChatActive(event.chat_id, active) && active) {
|
||||
refreshChatListSoon(true);
|
||||
}
|
||||
} else if (event.data?.type === 'chat:list') {
|
||||
} else if (
|
||||
event.data?.type === 'chat:list' &&
|
||||
typeof event.data.data?.last_read_at !== 'number'
|
||||
) {
|
||||
refreshChatListSoon(true);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user