From fe193bb0622b6f974602fe143406f0bbecbb2ac5 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Fri, 3 Apr 2026 20:47:16 +1100 Subject: [PATCH] feat: enhance sound playback in InviteNotifications and MessageNotifications with logging and error handling --- src/app/pages/client/ClientNonUIFeatures.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 1dba998..5973009 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -150,9 +150,14 @@ function InviteNotifications() { ); const playSound = useCallback(() => { + console.log('[InviteNotifications] playSound called, isElectron:', isElectron()); if (isElectron() && (window as any).electron?.audio?.playNotificationSound) { - (window as any).electron.audio.playNotificationSound('invite'); + console.log('[InviteNotifications] Using Electron audio API'); + (window as any).electron.audio.playNotificationSound('invite') + .then((result: any) => console.log('[InviteNotifications] Sound result:', result)) + .catch((err: any) => console.error('[InviteNotifications] Sound error:', err)); } else { + console.log('[InviteNotifications] Using HTML5 Audio fallback'); new Audio('./sound/invite.ogg').play().catch((err) => { console.error('[Audio] Failed to play invite sound:', err); }); @@ -296,9 +301,14 @@ function MessageNotifications() { ); const playSound = useCallback(() => { + console.log('[MessageNotifications] playSound called, isElectron:', isElectron()); if (isElectron() && (window as any).electron?.audio?.playNotificationSound) { - (window as any).electron.audio.playNotificationSound('message'); + console.log('[MessageNotifications] Using Electron audio API'); + (window as any).electron.audio.playNotificationSound('message') + .then((result: any) => console.log('[MessageNotifications] Sound result:', result)) + .catch((err: any) => console.error('[MessageNotifications] Sound error:', err)); } else { + console.log('[MessageNotifications] Using HTML5 Audio fallback'); new Audio('./sound/notification.ogg').play().catch((err) => { console.error('[Audio] Failed to play notification sound:', err); });