mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
enh: chat/channel notification toast
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
<div>
|
||||
{#if title}
|
||||
<div class=" text-[13px] font-medium mb-0.5 line-clamp-1">{title}</div>
|
||||
<div class=" text-[13px] font-medium mb-0.5 line-clamp-1 capitalize">{title}</div>
|
||||
{/if}
|
||||
|
||||
<div class=" line-clamp-2 text-xs self-center dark:text-gray-300 font-normal">
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
$socket?.off('channel-events', channelEventHandler);
|
||||
// $socket?.off('channel-events', channelEventHandler);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -323,33 +323,6 @@
|
||||
|
||||
history.messages[event.message_id] = message;
|
||||
}
|
||||
} else {
|
||||
await tick();
|
||||
const type = event?.data?.type ?? null;
|
||||
const data = event?.data?.data ?? null;
|
||||
|
||||
if (type === 'chat:completion') {
|
||||
const { done, content, title } = data;
|
||||
|
||||
if (done) {
|
||||
toast.custom(NotificationToast, {
|
||||
componentProps: {
|
||||
onClick: () => {
|
||||
goto(`/c/${event.chat_id}`);
|
||||
},
|
||||
content: content,
|
||||
title: title
|
||||
},
|
||||
duration: 15000,
|
||||
unstyled: true
|
||||
});
|
||||
}
|
||||
} else if (type === 'chat:title') {
|
||||
currentChatPage.set(1);
|
||||
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
||||
} else if (type === 'chat:tags') {
|
||||
allTags.set(await getAllTags(localStorage.token));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -453,7 +426,7 @@
|
||||
onDestroy(() => {
|
||||
chatIdUnsubscriber?.();
|
||||
window.removeEventListener('message', onMessageHandler);
|
||||
$socket?.off('chat-events');
|
||||
// $socket?.off('chat-events');
|
||||
});
|
||||
|
||||
// File upload functions
|
||||
|
||||
Reference in New Issue
Block a user