diff --git a/apps/server/src/services/runtime-service/RuntimeService.ts b/apps/server/src/services/runtime-service/RuntimeService.ts index 3f2d955dfe..e708b1cff0 100644 --- a/apps/server/src/services/runtime-service/RuntimeService.ts +++ b/apps/server/src/services/runtime-service/RuntimeService.ts @@ -232,7 +232,7 @@ class RuntimeService { // we need to reload in a few scenarios: // 1. we are not confident that changes do not affect running event (eg. all events where changed) - const safeOption = typeof affectedIds === 'undefined'; + const safeOption = affectedIds === undefined; // 2. the edited event is in memory (now or next) running // behind conditional to avoid doing unnecessary work const eventInMemory = safeOption ? false : this.affectsLoaded(affectedIds); diff --git a/apps/server/src/stores/runtimeState.ts b/apps/server/src/stores/runtimeState.ts index d9b9d1f18e..f11dec2941 100644 --- a/apps/server/src/stores/runtimeState.ts +++ b/apps/server/src/stores/runtimeState.ts @@ -266,6 +266,9 @@ export function loadNext( return; } + // temporarily reset this value to simplify loop logic + runtimeState.eventNext = null; + for (let i = eventIndex + 1; i < timedEvents.length; i++) { const event = timedEvents[i]; // we dont deal with events that are not playable