From 1dfc4861376cd6b0b2968818e2b432e763b337ac Mon Sep 17 00:00:00 2001 From: Marc Hyeler Date: Fri, 26 Apr 2024 03:07:11 +0000 Subject: [PATCH] update logic --- src/core/subscriptions.ts | 4 +++- src/core/utils/notify.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/subscriptions.ts b/src/core/subscriptions.ts index 16590afd..c713d3f0 100644 --- a/src/core/subscriptions.ts +++ b/src/core/subscriptions.ts @@ -85,7 +85,9 @@ export const subscribeAll = ( ...messagePacket, state: messagePacket.from !== myNodeNum ? "ack" : "waiting", }); - playNotificationSound(); + if(messagePacket.from !== myNodeNum){ + playNotificationSound(); + } }); connection.events.onPendingSettingsChange.subscribe((state) => { diff --git a/src/core/utils/notify.ts b/src/core/utils/notify.ts index 3ffec809..ef0f0f99 100644 --- a/src/core/utils/notify.ts +++ b/src/core/utils/notify.ts @@ -10,6 +10,7 @@ export const playNotificationSound = () => { isPlaying = true; notificationSound.play(); + notificationSound.onended = () => { isPlaying = false; };