浏览代码

Bugfix. Make sure arguments are passed to all triggered events

JC Brand 4 年之前
父节点
当前提交
2f5cc3b271
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/headless/core.js

+ 2 - 1
src/headless/core.js

@@ -439,7 +439,8 @@ export const api = _converse.api = {
         const options = args.pop();
         const options = args.pop();
         if (options && options.synchronous) {
         if (options && options.synchronous) {
             const events = _converse._events[name] || [];
             const events = _converse._events[name] || [];
-            await Promise.all(events.map(e => e.callback.apply(e.ctx, args.splice(1))));
+            const event_args = args.splice(1);
+            await Promise.all(events.map(e => e.callback.apply(e.ctx, event_args)));
         } else {
         } else {
             _converse.trigger.apply(_converse, arguments);
             _converse.trigger.apply(_converse, arguments);
         }
         }