fix: issue where event next was stale

This commit is contained in:
Carlos Valente
2024-09-24 21:44:29 +02:00
committed by Carlos Valente
parent 177c9a35ec
commit fa709dc9be
2 changed files with 4 additions and 1 deletions
@@ -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);
+3
View File
@@ -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