diff options
Diffstat (limited to 'ext/js/templates/sandbox/template-renderer-frame-api.js')
-rw-r--r-- | ext/js/templates/sandbox/template-renderer-frame-api.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/js/templates/sandbox/template-renderer-frame-api.js b/ext/js/templates/sandbox/template-renderer-frame-api.js index 388401f2..56cedb97 100644 --- a/ext/js/templates/sandbox/template-renderer-frame-api.js +++ b/ext/js/templates/sandbox/template-renderer-frame-api.js @@ -27,10 +27,10 @@ export class TemplateRendererFrameApi { /** @type {import('./template-renderer.js').TemplateRenderer} */ this._templateRenderer = templateRenderer; /** @type {import('core').MessageHandlerMap} */ - this._windowMessageHandlers = new Map(/** @type {import('core').MessageHandlerArray} */ ([ - ['render', {async: false, handler: this._onRender.bind(this)}], - ['renderMulti', {async: false, handler: this._onRenderMulti.bind(this)}], - ['getModifiedData', {async: false, handler: this._onGetModifiedData.bind(this)}] + this._windowMessageHandlers = new Map(/** @type {import('core').MessageHandlerMapInit} */ ([ + ['render', this._onRender.bind(this)], + ['renderMulti', this._onRenderMulti.bind(this)], + ['getModifiedData', this._onGetModifiedData.bind(this)] ])); } @@ -56,17 +56,17 @@ export class TemplateRendererFrameApi { } /** - * @param {import('core').MessageHandlerDetails} handlerItem + * @param {import('core').MessageHandler} handler * @param {string} action * @param {import('core').SerializableObject} params * @param {Window} source * @param {?string} id */ - async _onWindowMessageInner({handler, async}, action, params, source, id) { + async _onWindowMessageInner(handler, action, params, source, id) { let response; try { let result = handler(params); - if (async) { + if (result instanceof Promise) { result = await result; } response = {result}; |