mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 08:23:55 +00:00
bugfix: timer negative on goto
when jumping events using goto, start time would not be set
This commit is contained in:
@@ -50,6 +50,9 @@ class Timer {
|
||||
// check playstate
|
||||
switch (this.state) {
|
||||
case 'start':
|
||||
// ensure we have a start time
|
||||
if (this._startedAt == null) this._startedAt = now;
|
||||
|
||||
// update current timer
|
||||
this.current =
|
||||
this._startedAt + this.duration + this._pausedTotal - now;
|
||||
|
||||
@@ -63,6 +63,7 @@ const initiateOSC = (config) => {
|
||||
try {
|
||||
let eventIndex = parseInt(args);
|
||||
if (isNaN(eventIndex) || eventIndex <= 0) return;
|
||||
global.timer.pause();
|
||||
global.timer.loadEvent(eventIndex - 1, undefined, true);
|
||||
} catch (error) {
|
||||
console.log('error calling goto: ', error);
|
||||
|
||||
Reference in New Issue
Block a user