mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +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
|
// check playstate
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case 'start':
|
case 'start':
|
||||||
|
// ensure we have a start time
|
||||||
|
if (this._startedAt == null) this._startedAt = now;
|
||||||
|
|
||||||
// update current timer
|
// update current timer
|
||||||
this.current =
|
this.current =
|
||||||
this._startedAt + this.duration + this._pausedTotal - now;
|
this._startedAt + this.duration + this._pausedTotal - now;
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const initiateOSC = (config) => {
|
|||||||
try {
|
try {
|
||||||
let eventIndex = parseInt(args);
|
let eventIndex = parseInt(args);
|
||||||
if (isNaN(eventIndex) || eventIndex <= 0) return;
|
if (isNaN(eventIndex) || eventIndex <= 0) return;
|
||||||
|
global.timer.pause();
|
||||||
global.timer.loadEvent(eventIndex - 1, undefined, true);
|
global.timer.loadEvent(eventIndex - 1, undefined, true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error calling goto: ', error);
|
console.log('error calling goto: ', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user