Skip to content

Commit 53836a2

Browse files
committed
Only play the waiting sound 3 times
Signed-off-by: Joas Schilling <[email protected]>
1 parent 014460d commit 53836a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/sounds.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const Sounds = {
2727
isInCall: false,
2828
lastPlayedJoin: 0,
2929
lastPlayedLeave: 0,
30+
playedWaiting: 0,
3031
backgroundAudio: null,
3132
backgroundInterval: null,
3233

@@ -52,13 +53,20 @@ export const Sounds = {
5253
console.debug('Playing waiting sound')
5354
this.backgroundAudio.play()
5455

56+
this.playedWaiting = 0
5557
this.backgroundInterval = setInterval(() => {
5658
if (!store.getters.playSounds) {
5759
return
5860
}
5961

6062
console.debug('Playing waiting sound')
6163
this.backgroundAudio.play()
64+
this.playedWaiting++
65+
66+
if (this.playedWaiting >= 3) {
67+
// Played 3 times, so we stop now.
68+
clearInterval(this.backgroundInterval)
69+
}
6270
}, 15000)
6371
},
6472

@@ -91,7 +99,7 @@ export const Sounds = {
9199
}
92100

93101
if (playWaitingSound) {
94-
this.playWaiting()
102+
await this.playWaiting()
95103
} else {
96104
this._playSounceOnce('LibremEmailNotification.ogg')
97105
}

0 commit comments

Comments
 (0)