From 76cf24fe9a04d52a4522f7f129156e9fb2be3cd1 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Tue, 26 Dec 2023 19:46:50 +0100 Subject: [PATCH] Fix: only play sounds on current players device --- js/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/index.js b/js/index.js index 01da5bd..47c36f6 100644 --- a/js/index.js +++ b/js/index.js @@ -52,9 +52,10 @@ function Timer() { (new Date().getTime() - lastPlayerSwitch)) / 1000 ); - if (this.time == 10) { + + if (this.time == 10 && Alpine.store("remoteState").isMyTurn) { Alpine.store("audio").playTimeAlmostOver(); - } else if (this.time == 0) { + } else if (this.time == 0 && Alpine.store("remoteState").isMyTurn) { Alpine.store("audio").playTimeOver(); } }