From fd81c23414ce86af71032c4debfe991023454739 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Tue, 19 May 2026 14:32:07 +0300 Subject: [PATCH] fix: prevent duplicate desktop notifications Desktop shells no longer subscribe to the browser notification stream Electron keeps using the native desktop notification path only Web browser notifications continue to use the notification stream --- packages/ui/src/hooks/useWebNotificationStream.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/hooks/useWebNotificationStream.ts b/packages/ui/src/hooks/useWebNotificationStream.ts index 3c5db075..b2f541fc 100644 --- a/packages/ui/src/hooks/useWebNotificationStream.ts +++ b/packages/ui/src/hooks/useWebNotificationStream.ts @@ -1,6 +1,6 @@ import React from 'react'; import { getRegisteredRuntimeAPIs } from '@/contexts/runtimeAPIRegistry'; -import { isWebRuntime } from '@/lib/desktop'; +import { isDesktopShell, isWebRuntime } from '@/lib/desktop'; import { useUIStore } from '@/stores/useUIStore'; import type { NotificationPayload } from '@/lib/api/types'; @@ -29,7 +29,7 @@ export const useWebNotificationStream = (options?: { enabled?: boolean }) => { const enabled = options?.enabled ?? true; React.useEffect(() => { - if (!enabled || !isWebRuntime() || typeof window === 'undefined' || typeof EventSource === 'undefined') { + if (!enabled || isDesktopShell() || !isWebRuntime() || typeof window === 'undefined' || typeof EventSource === 'undefined') { return; }