refactor: always reload on changes

This commit is contained in:
Carlos Valente
2025-07-13 17:32:10 +02:00
parent 445cc9e845
commit dd47d2b7e7
3 changed files with 11 additions and 80 deletions
@@ -538,26 +538,11 @@ type NotifyChangesOptions = {
/**
* Notify services of changes in the rundown
*
* @private - exported for testing
*/
export function notifyChanges(rundownMetadata: RundownMetadata, revision: number, options: NotifyChangesOptions) {
function notifyChanges(rundownMetadata: RundownMetadata, revision: number, options: NotifyChangesOptions) {
// notify timer service of changed events
if (options.timer) {
// all events were deleted
if (rundownMetadata.playableEventOrder.length === 0) {
runtimeService.stop();
} else {
/**
* Timer can be
* - true: all events changed
* - an array of changed IDs
* - undefined: filtered above, no notification intended
*/
// timer can be true or an array of changed IDs
const affected = Array.isArray(options.timer) ? options.timer : undefined;
runtimeService.notifyOfChangedEvents(affected);
}
runtimeService.notifyOfChangedEvents(rundownMetadata);
}
// notify external services of changes