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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user