Browse Source

Bugfix. Pass correct arguments to synchronous event handlers

JC Brand 5 năm trước cách đây
mục cha
commit
0fa95ccd50
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/headless/converse-core.js

+ 1 - 1
src/headless/converse-core.js

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