mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-26 23:29:24 -05:00
fix: Mark all as read in the folder tab's menu marks the folder's chats as read (#34404)
This commit is contained in:
1 file changed
+18
-1
@@ -15,8 +15,14 @@
|
||||
type FolderDetails
|
||||
} from '$lib/stores/folderStates';
|
||||
|
||||
import { deleteFolderById, updateFolderById, createNewFolder } from '$lib/apis/folders';
|
||||
import {
|
||||
deleteFolderById,
|
||||
updateFolderById,
|
||||
createNewFolder,
|
||||
markFolderChatsReadById
|
||||
} from '$lib/apis/folders';
|
||||
import { getChatsByFolderId } from '$lib/apis/chats';
|
||||
import { refreshSidebar } from '$lib/stores/chatList';
|
||||
|
||||
import FolderModal from '$lib/components/layout/Sidebar/Folders/FolderModal.svelte';
|
||||
import FolderShareModal from '$lib/components/layout/Sidebar/Folders/FolderShareModal.svelte';
|
||||
@@ -105,6 +111,16 @@
|
||||
}
|
||||
};
|
||||
|
||||
const markAllReadHandler = async () => {
|
||||
const res = await markFolderChatsReadById(localStorage.token, folder.id).catch((error) => {
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
if (!res) return;
|
||||
|
||||
await refreshSidebar(localStorage.token);
|
||||
};
|
||||
|
||||
const exportHandler = async () => {
|
||||
const chats = await getChatsByFolderId(localStorage.token, folder.id).catch((error) => {
|
||||
toast.error(`${error}`);
|
||||
@@ -160,6 +176,7 @@
|
||||
onExport={() => {
|
||||
exportHandler();
|
||||
}}
|
||||
onMarkAllRead={markAllReadHandler}
|
||||
onCreateSubFolder={() => {
|
||||
showCreateSubFolderModal = true;
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user