diff --git a/src/lib/components/ComfyApp.ts b/src/lib/components/ComfyApp.ts index 2c77775..e4c7625 100644 --- a/src/lib/components/ComfyApp.ts +++ b/src/lib/components/ComfyApp.ts @@ -728,9 +728,11 @@ export default class ComfyApp { } private requestPermissions() { - if (Notification.permission === "default") { - Notification.requestPermission() - .then((result) => console.log("Notification status:", result)); + if (window.Notification != null) { + if (window.Notification.permission === "default") { + window.Notification.requestPermission() + .then((result) => console.log("Notification status:", result)); + } } } diff --git a/src/lib/notify.ts b/src/lib/notify.ts index 80a0f2c..90caee9 100644 --- a/src/lib/notify.ts +++ b/src/lib/notify.ts @@ -92,6 +92,11 @@ function notifyToast(text: string, options: NotifyOptions) { } function notifyNative(text: string, options: NotifyOptions) { + if (window.Notification == null) { + console.warn("[notify] No Notification available on window") + return + } + if (document.hasFocus()) return;