extract isPlaybackActive to a global util function (#1393)

This commit is contained in:
Alex Christoffer Rasmussen
2024-12-18 12:44:48 +01:00
committed by GitHub
parent df1cf7a96b
commit cfcf6a5684
5 changed files with 25 additions and 19 deletions
+9 -3
View File
@@ -11,7 +11,14 @@ import {
TimerPhase,
TimerState,
} from 'ontime-types';
import { calculateDuration, checkIsNow, dayInMs, filterTimedEvents, getPreviousBlock } from 'ontime-utils';
import {
calculateDuration,
checkIsNow,
dayInMs,
filterTimedEvents,
getPreviousBlock,
isPlaybackActive,
} from 'ontime-utils';
import { clock } from '../services/Clock.js';
import { RestorePoint } from '../services/RestoreService.js';
@@ -21,7 +28,6 @@ import {
getExpectedFinish,
getRuntimeOffset,
getTimerPhase,
isPlaybackActive,
} from '../services/timerUtils.js';
import { timerConfig } from '../config/config.js';
import { loadRoll, normaliseRollStart } from '../services/rollUtils.js';
@@ -485,7 +491,7 @@ export function update(): UpdateResult {
runtimeState.clock = clock.timeNow(); // we update the clock on every update call
// 1. is playback idle?
if (!isPlaybackActive(runtimeState)) {
if (!isPlaybackActive(runtimeState.timer.playback)) {
return updateIfIdle();
}