Corrections zones

This commit is contained in:
Sébastien Rivière
2025-06-26 14:20:23 +02:00
parent d25dcfcbc1
commit 2f5116b88a
4 changed files with 16 additions and 12 deletions

View File

@@ -183,9 +183,12 @@ export default {
goNextZone() {
this.currentZone.id++;
if (this.currentZone.id >= this.zones.length) return;
this.currentZone.timeoutId = setTimeout(() => this.goNextZone(), this.getCurrentZone().duration * 60 * 1000);
this.currentZone.endDate = Date.now() + this.getCurrentZone().duration * 60 * 1000;
if (this.currentZone.id >= this.zones.length - 1) {
this.currentZone.endDate = Date.now();
} else {
this.currentZone.timeoutId = setTimeout(() => this.goNextZone(), this.getCurrentZone().duration * 60 * 1000);
this.currentZone.endDate = Date.now() + this.getCurrentZone().duration * 60 * 1000;
}
this.zoneBroadcast();
},