fix(search): wire up mark as unread in the search chats modal (#28136)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
archiveChatById,
|
||||
updateChatById,
|
||||
updateChatFolderIdById,
|
||||
markChatUnreadById,
|
||||
getAllTags
|
||||
} from '$lib/apis/chats';
|
||||
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) => {
|
||||
try {
|
||||
await archiveChatById(localStorage.token, id);
|
||||
@@ -818,6 +830,9 @@
|
||||
renameHandler={() => {
|
||||
renameHandler(chat.id);
|
||||
}}
|
||||
markUnreadHandler={() => {
|
||||
markUnreadHandler(chat.id);
|
||||
}}
|
||||
deleteHandler={() => {
|
||||
menuChatId = chat.id;
|
||||
menuChatTitle = chat.title;
|
||||
|
||||
Reference in New Issue
Block a user