From 937106d49ccc7361a2ab1a56e967d87a832bebf2 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Sat, 15 May 2021 23:52:53 +0200 Subject: [PATCH] bugfix: on prev <> next skipping through events while playing would cause false data in clock --- server/classes/EventTimer.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/classes/EventTimer.js b/server/classes/EventTimer.js index 7692f039c..ae47ba885 100644 --- a/server/classes/EventTimer.js +++ b/server/classes/EventTimer.js @@ -734,14 +734,15 @@ class EventTimer extends Timer { this.loadEvent(0); return; } + + // change playstate + this.pause(); + const gotoEvent = this.selectedEventIndex > 0 ? this.selectedEventIndex - 1 : 0; if (gotoEvent === this.selectedEventIndex) return; this.loadEvent(gotoEvent); - - // change playstate - this.pause(); } next() { @@ -754,6 +755,9 @@ class EventTimer extends Timer { return; } + // change playstate + this.pause(); + const gotoEvent = this.selectedEventIndex < this.numEvents - 1 ? this.selectedEventIndex + 1 @@ -761,9 +765,6 @@ class EventTimer extends Timer { if (gotoEvent === this.selectedEventIndex) return; this.loadEvent(gotoEvent); - - // change playstate - this.pause(); } unload() {