From 8cda9eac0a458a9aed416241cf7b3e264f534cad Mon Sep 17 00:00:00 2001 From: arc-alex Date: Mon, 10 Mar 2025 22:57:04 +0100 Subject: [PATCH] send imediat update on mode change --- apps/server/src/services/runtime-service/RuntimeService.ts | 5 ++++- apps/server/src/stores/runtimeState.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/server/src/services/runtime-service/RuntimeService.ts b/apps/server/src/services/runtime-service/RuntimeService.ts index ff6215e88..4e44a3673 100644 --- a/apps/server/src/services/runtime-service/RuntimeService.ts +++ b/apps/server/src/services/runtime-service/RuntimeService.ts @@ -707,11 +707,14 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert // for the very fist run there will be nothing in the previousState so we force an update const justStarted = !RuntimeService.previousState?.timer; + // offset mode has been changed + const offsetModeChanged = RuntimeService.previousState?.runtime?.offsetMode !== state.runtime.offsetMode; + // if playback changes most things should update const hasChangedPlayback = RuntimeService.previousState.timer?.playback !== state.timer.playback; // combine all big changes - const hasImmediateChanges = hasNewLoaded || justStarted || hasChangedPlayback; + const hasImmediateChanges = hasNewLoaded || justStarted || hasChangedPlayback || offsetModeChanged; /** * Timer should be updated if diff --git a/apps/server/src/stores/runtimeState.ts b/apps/server/src/stores/runtimeState.ts index 5776aad6e..9d342ed73 100644 --- a/apps/server/src/stores/runtimeState.ts +++ b/apps/server/src/stores/runtimeState.ts @@ -84,7 +84,7 @@ export function getState(): Readonly { }; } -//TODO: find other thinbgs that dose not need clearing +//TODO: find other things that dose not need clearing export function softClear() { runtimeState.eventNow = null; runtimeState.publicEventNow = null;