mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
More batch (#1468)
* batch updates in client * rearange updating logic * utilety type * guard undefinde in affectsLoaded * fix: pause state not saved to restore point
This commit is contained in:
committed by
GitHub
parent
bb1e9072fd
commit
d34280c03d
@@ -136,10 +136,14 @@ export function clear() {
|
||||
* Utility to allow modifying the state from the outside
|
||||
* @param newState
|
||||
*/
|
||||
function patchTimer(newState: Partial<TimerState>) {
|
||||
function patchTimer(newState: Partial<TimerState & RestorePoint>) {
|
||||
for (const key in newState) {
|
||||
if (key in runtimeState.timer) {
|
||||
runtimeState.timer[key] = newState[key];
|
||||
} else if (key in runtimeState._timer) {
|
||||
// in case of a RestorePoint we will receive a pausedAt value
|
||||
// wiche is needed to resume a paused timer
|
||||
runtimeState._timer[key] = newState[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user