diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index e4b54e4..1dba998 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -150,12 +150,13 @@ function InviteNotifications() { ); const playSound = useCallback(() => { - console.log('[InviteNotifications] playSound called'); - // Use HTML5 Audio - works reliably in Chromium/Electron (supports OGG) - const audio = new Audio('/sound/invite.ogg'); - audio.play().catch((err) => { - console.error('[Audio] Failed to play invite sound:', err); - }); + if (isElectron() && (window as any).electron?.audio?.playNotificationSound) { + (window as any).electron.audio.playNotificationSound('invite'); + } else { + new Audio('./sound/invite.ogg').play().catch((err) => { + console.error('[Audio] Failed to play invite sound:', err); + }); + } }, []); useEffect(() => { @@ -295,13 +296,13 @@ function MessageNotifications() { ); const playSound = useCallback(() => { - console.log('[MessageNotifications] playSound called'); - // Use HTML5 Audio - works reliably in Chromium/Electron (supports OGG) - // Main process audio is unreliable on Windows (can't play OGG natively) - const audio = new Audio('/sound/notification.ogg'); - audio.play().catch((err) => { - console.error('[Audio] Failed to play notification sound:', err); - }); + if (isElectron() && (window as any).electron?.audio?.playNotificationSound) { + (window as any).electron.audio.playNotificationSound('message'); + } else { + new Audio('./sound/notification.ogg').play().catch((err) => { + console.error('[Audio] Failed to play notification sound:', err); + }); + } }, []); useEffect(() => {