bugfix: on prev <> next

skipping through events while playing would cause false data in clock
This commit is contained in:
cv
2021-05-15 23:52:53 +02:00
parent 5959053e94
commit 937106d49c
+7 -6
View File
@@ -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() {