diff --git a/apps/server/src/services/__tests__/timerUtils.test.ts b/apps/server/src/services/__tests__/timerUtils.test.ts index 6026004cf..07d7f9ed9 100644 --- a/apps/server/src/services/__tests__/timerUtils.test.ts +++ b/apps/server/src/services/__tests__/timerUtils.test.ts @@ -1248,9 +1248,11 @@ describe('getTimerPhase()', () => { }, _timer: { forceFinish: null, - totalDelay: 0, pausedAt: null, }, + _rundown: { + totalDelay: 0, + }, } as RuntimeState; const phase = getTimerPhase(state); @@ -1287,9 +1289,11 @@ describe('getTimerPhase()', () => { }, _timer: { forceFinish: null, - totalDelay: 0, pausedAt: null, }, + _rundown: { + totalDelay: 0, + }, } as RuntimeState; const phase = getTimerPhase(state); diff --git a/apps/server/src/services/timerUtils.ts b/apps/server/src/services/timerUtils.ts index 2af1034f1..003f76314 100644 --- a/apps/server/src/services/timerUtils.ts +++ b/apps/server/src/services/timerUtils.ts @@ -181,7 +181,7 @@ export function getExpectedEnd(state: RuntimeState): MaybeNumber { if (state.runtime.actualStart === null || state.runtime.plannedEnd === null) { return null; } - return state.runtime.plannedEnd - state.runtime.offset + state._timer.totalDelay; + return state.runtime.plannedEnd - state.runtime.offset + state._rundown.totalDelay; } /** diff --git a/apps/server/src/stores/__mocks__/runtimeState.mocks.ts b/apps/server/src/stores/__mocks__/runtimeState.mocks.ts index 02b1eac42..074aa08d7 100644 --- a/apps/server/src/stores/__mocks__/runtimeState.mocks.ts +++ b/apps/server/src/stores/__mocks__/runtimeState.mocks.ts @@ -37,10 +37,12 @@ const baseState: RuntimeState = { }, _timer: { forceFinish: null, - totalDelay: 0, pausedAt: null, secondaryTarget: null, }, + _rundown: { + totalDelay: 0, + }, }; export function makeRuntimeStateData(patch?: Partial): RuntimeState { diff --git a/apps/server/src/stores/runtimeState.ts b/apps/server/src/stores/runtimeState.ts index 289cabc3b..9f7f17f32 100644 --- a/apps/server/src/stores/runtimeState.ts +++ b/apps/server/src/stores/runtimeState.ts @@ -47,10 +47,12 @@ export type RuntimeState = { // private properties of the timer calculations _timer: { forceFinish: MaybeNumber; // whether we should declare an event as finished, will contain the finish time - totalDelay: number; // this value comes from rundown service pausedAt: MaybeNumber; secondaryTarget: MaybeNumber; }; + _rundown: { + totalDelay: number; // this value comes from rundown service + }; }; const runtimeState: RuntimeState = { @@ -64,10 +66,12 @@ const runtimeState: RuntimeState = { timer: { ...runtimeStorePlaceholder.timer }, _timer: { forceFinish: null, - totalDelay: 0, pausedAt: null, secondaryTarget: null, }, + _rundown: { + totalDelay: 0, + }, }; export function getState(): Readonly { @@ -81,6 +85,7 @@ export function getState(): Readonly { runtime: { ...runtimeState.runtime }, timer: { ...runtimeState.timer }, _timer: { ...runtimeState._timer }, + _rundown: { totalDelay: 0 }, }; } @@ -165,7 +170,7 @@ type RundownData = { */ export function updateRundownData(rundownData: RundownData) { // we keep this in private state since there is no UI use case for it - runtimeState._timer.totalDelay = rundownData.totalDelay; + runtimeState._rundown.totalDelay = rundownData.totalDelay; runtimeState.runtime.numEvents = rundownData.numEvents; runtimeState.runtime.plannedStart = rundownData.firstStart;