stop ring on pause

This commit is contained in:
Christopher Poile
2023-06-16 12:50:57 -04:00
parent 6d4ff63936
commit 83d62ad02d

View File

@@ -54,6 +54,9 @@ export function ring(name: string) {
stopRing();
currentRing = loopNotificationRing(name);
currentRing.addEventListener('pause', () => {
stopRing();
});
}
export function stopRing() {
@@ -75,6 +78,10 @@ export function tryNotificationRing(name: string) {
clearTimeout(currentTimer);
currentTryRing = loopNotificationRing(name);
currentTryRing.addEventListener('pause', () => {
stopTryNotificationRing();
});
currentTimer = setTimeout(() => {
stopTryNotificationRing();
}, 5000);