fix: add missing os_listener toggle to notification CSS editor
Some checks failed
Lint & Test / test (push) Failing after 27s
Some checks failed
Lint & Test / test (push) Failing after 27s
The os_listener field existed in the backend model but was never exposed in the UI. It defaulted to false, so OS notifications were captured to history but never fired the visual effect. Now shows a toggle at the top of the notification section, defaults to ON for new sources.
This commit is contained in:
@@ -217,6 +217,7 @@ export function notificationGetAppColorsDict() {
|
||||
}
|
||||
|
||||
export function loadNotificationState(css: any) {
|
||||
(document.getElementById('css-editor-notification-os-listener') as HTMLInputElement).checked = !!css.os_listener;
|
||||
(document.getElementById('css-editor-notification-effect') as HTMLInputElement).value = css.notification_effect || 'flash';
|
||||
if (_notificationEffectIconSelect) _notificationEffectIconSelect.setValue(css.notification_effect || 'flash');
|
||||
const dur = css.duration_ms ?? 1500;
|
||||
@@ -238,6 +239,7 @@ export function loadNotificationState(css: any) {
|
||||
}
|
||||
|
||||
export function resetNotificationState() {
|
||||
(document.getElementById('css-editor-notification-os-listener') as HTMLInputElement).checked = true;
|
||||
(document.getElementById('css-editor-notification-effect') as HTMLInputElement).value = 'flash';
|
||||
if (_notificationEffectIconSelect) _notificationEffectIconSelect.setValue('flash');
|
||||
(document.getElementById('css-editor-notification-duration') as HTMLInputElement).value = 1500 as any;
|
||||
|
||||
@@ -90,6 +90,7 @@ class CSSEditorModal extends Modal {
|
||||
audio_mirror: (document.getElementById('css-editor-audio-mirror') as HTMLInputElement).checked,
|
||||
api_input_fallback_color: (document.getElementById('css-editor-api-input-fallback-color') as HTMLInputElement).value,
|
||||
api_input_timeout: (document.getElementById('css-editor-api-input-timeout') as HTMLInputElement).value,
|
||||
notification_os_listener: (document.getElementById('css-editor-notification-os-listener') as HTMLInputElement).checked,
|
||||
notification_effect: (document.getElementById('css-editor-notification-effect') as HTMLInputElement).value,
|
||||
notification_duration: (document.getElementById('css-editor-notification-duration') as HTMLInputElement).value,
|
||||
notification_default_color: (document.getElementById('css-editor-notification-default-color') as HTMLInputElement).value,
|
||||
@@ -1444,6 +1445,7 @@ const _typeHandlers: Record<string, { load: (...args: any[]) => any; reset: (...
|
||||
.split('\n').map(s => s.trim()).filter(Boolean);
|
||||
return {
|
||||
name,
|
||||
os_listener: (document.getElementById('css-editor-notification-os-listener') as HTMLInputElement).checked,
|
||||
notification_effect: (document.getElementById('css-editor-notification-effect') as HTMLInputElement).value,
|
||||
duration_ms: parseInt((document.getElementById('css-editor-notification-duration') as HTMLInputElement).value) || 1500,
|
||||
default_color: (document.getElementById('css-editor-notification-default-color') as HTMLInputElement).value,
|
||||
|
||||
Reference in New Issue
Block a user