refac
This commit is contained in:
1 parent
29ee53aaa5
commit
e5b5a17426
5 files changed
+244
-22
No files matched your search
@@ -439,6 +439,38 @@
|
||||
const type = event?.data?.type ?? null;
|
||||
const data = event?.data?.data ?? null;
|
||||
|
||||
// Calendar alerts are not chat-scoped — handle before chat_id checks
|
||||
if (type === 'calendar:alert' && data) {
|
||||
const timeStr =
|
||||
data.minutes_until <= 0
|
||||
? $i18n.t('Starting now')
|
||||
: data.minutes_until === 1
|
||||
? $i18n.t('Starting in 1 minute')
|
||||
: $i18n.t('Starting in {{count}} minutes', { count: data.minutes_until });
|
||||
|
||||
toast.custom(NotificationToast, {
|
||||
componentProps: {
|
||||
onClick: () => {
|
||||
goto('/calendar');
|
||||
},
|
||||
title: data.title,
|
||||
content: timeStr
|
||||
},
|
||||
duration: 30000,
|
||||
unstyled: true
|
||||
});
|
||||
|
||||
if ($isLastActiveTab) {
|
||||
if ($settings?.notificationEnabled ?? false) {
|
||||
new Notification(`${data.title} • Open WebUI`, {
|
||||
body: timeStr,
|
||||
icon: `${WEBUI_BASE_URL}/static/favicon.png`
|
||||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((event.chat_id !== $chatId && !$temporaryChatEnabled) || isFocused) {
|
||||
if (type === 'chat:completion') {
|
||||
const { done, content, title } = data;
|
||||
|
||||
Reference in new issue
Block a user