From 8488ffeb2420b064b26d68583da37edbb3268c4e Mon Sep 17 00:00:00 2001 From: arc-alex Date: Sat, 25 Jan 2025 15:09:36 +0100 Subject: [PATCH] fix: pause state not saved to restore point --- apps/server/src/services/runtime-service/RuntimeService.ts | 2 +- apps/server/src/stores/runtimeState.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/server/src/services/runtime-service/RuntimeService.ts b/apps/server/src/services/runtime-service/RuntimeService.ts index f6e53a87eb..2d6fe844ff 100644 --- a/apps/server/src/services/runtime-service/RuntimeService.ts +++ b/apps/server/src/services/runtime-service/RuntimeService.ts @@ -721,7 +721,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert !deepEqual(RuntimeService.previousState?.runtime, state.runtime); /** - * the currentBlock object has no ticking values so we only need to check for equallety + * the currentBlock object has no ticking values so we only need to check for equality */ const shouldBlockUpdate = !deepEqual(RuntimeService?.previousState.currentBlock, state.currentBlock); diff --git a/apps/server/src/stores/runtimeState.ts b/apps/server/src/stores/runtimeState.ts index 0df5c805e2..7f7ceb502f 100644 --- a/apps/server/src/stores/runtimeState.ts +++ b/apps/server/src/stores/runtimeState.ts @@ -136,10 +136,14 @@ export function clear() { * Utility to allow modifying the state from the outside * @param newState */ -function patchTimer(newState: Partial) { +function patchTimer(newState: Partial) { 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]; } } }