diff --git a/app/core/Engine.ts b/app/core/Engine.ts index 6dff1e65f456..8a38ec271950 100644 --- a/app/core/Engine.ts +++ b/app/core/Engine.ts @@ -1354,12 +1354,8 @@ class Engine { } } - this.datamodel = new ComposableController< - EngineState, - Controllers[keyof Controllers] - >({ - controllers, - messenger: this.controllerMessenger.getRestricted({ + const composableControllerMessenger = + this.controllerMessenger.getRestricted({ name: 'ComposableController', allowedActions: [], // Add `stateChange` event here and in the `GlobalEvents` type @@ -1385,7 +1381,13 @@ class Engine { 'SnapController:stateChange', 'SubjectMetadataController:stateChange', ], - }), + }); + this.datamodel = new ComposableController< + EngineState, + Controllers[keyof Controllers] + >({ + controllers, + messenger: composableControllerMessenger, }); this.context = controllers.reduce>( (context, controller) => ({