use expectedFinish

This commit is contained in:
arc-alex
2023-11-28 15:27:19 +01:00
parent 20d5d8b129
commit ecd151a0a8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -404,7 +404,7 @@ export class TimerService {
let shouldNotify = false; let shouldNotify = false;
if (this.playback === Playback.Roll) { if (this.playback === Playback.Roll) {
shouldNotify = true; shouldNotify = true;
if (skipedOutOfEvent(previousTime, this.timer.clock, this.timer.startedAt, this.timer.finishedAt)) { if (skipedOutOfEvent(previousTime, this.timer.clock, this.timer.startedAt, this.timer.expectedFinish)) {
PlaybackService.roll(); PlaybackService.roll();
} else { } else {
this.updateRoll(); this.updateRoll();
+2 -2
View File
@@ -66,11 +66,11 @@ export function getCurrent(
return startedAt + duration + addedTime + pausedTime - clock; return startedAt + duration + addedTime + pausedTime - clock;
} }
export function skipedOutOfEvent(previousTime: number, clock: number, startedAt: number, finishAt): boolean { export function skipedOutOfEvent(previousTime: number, clock: number, startedAt: number, expectedFinish): boolean {
const skipTime = previousTime - clock; const skipTime = previousTime - clock;
const hasSkipped = Math.abs(skipTime) > config.timeSkipLimit; const hasSkipped = Math.abs(skipTime) > config.timeSkipLimit;
if (hasSkipped) { if (hasSkipped) {
if (clock > finishAt || clock < startedAt) { if (clock > expectedFinish || clock < startedAt) {
return true; return true;
} }
// otherwise we just skipped within the event // otherwise we just skipped within the event