fix(search): wire up mark as unread in the search chats modal (#28136)

This commit is contained in:
G30 authored and GitHub committed 2026-08-17 00:34:49 -06:00
1 parent 736e38338e
commit 884388cac3
1 file changed
+15
@@ -14,6 +14,7 @@
archiveChatById, archiveChatById,
updateChatById, updateChatById,
updateChatFolderIdById, updateChatFolderIdById,
markChatUnreadById,
getAllTags getAllTags
} from '$lib/apis/chats'; } from '$lib/apis/chats';
import Spinner from '../common/Spinner.svelte'; import Spinner from '../common/Spinner.svelte';
@@ -87,6 +88,17 @@
} }
}; };
const markUnreadHandler = async (id) => {
const res = await markChatUnreadById(localStorage.token, id).catch((error) => {
toast.error(`${error}`);
return null;
});
if (res) {
await refreshSidebar();
}
};
const archiveChatHandler = async (id) => { const archiveChatHandler = async (id) => {
try { try {
await archiveChatById(localStorage.token, id); await archiveChatById(localStorage.token, id);
@@ -818,6 +830,9 @@
renameHandler={() => { renameHandler={() => {
renameHandler(chat.id); renameHandler(chat.id);
}} }}
markUnreadHandler={() => {
markUnreadHandler(chat.id);
}}
deleteHandler={() => { deleteHandler={() => {
menuChatId = chat.id; menuChatId = chat.id;
menuChatTitle = chat.title; menuChatTitle = chat.title;