mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
send imediat update on mode change
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -84,7 +84,7 @@ export function getState(): Readonly<RuntimeState> {
|
||||
};
|
||||
}
|
||||
|
||||
//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;
|
||||
|
||||
Reference in New Issue
Block a user