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
This commit is contained in:
Bohdan Triapitsyn
2026-05-19 14:32:07 +03:00
parent 237558130e
commit fd81c23414
@@ -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;
}