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;
if (this.playback === Playback.Roll) {
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();
} else {
this.updateRoll();
+2 -2
View File
@@ -66,11 +66,11 @@ export function getCurrent(
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 hasSkipped = Math.abs(skipTime) > config.timeSkipLimit;
if (hasSkipped) {
if (clock > finishAt || clock < startedAt) {
if (clock > expectedFinish || clock < startedAt) {
return true;
}
// otherwise we just skipped within the event