2
0
Эх сурвалжийг харах

Bugfix. Pass correct arguments to synchronous event handlers

JC Brand 5 жил өмнө
parent
commit
0fa95ccd50

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

@@ -1565,7 +1565,7 @@ _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.call(e.ctx, args)));
+            await Promise.all(events.map(e => e.callback.apply(e.ctx, args.splice(1))));
         } else {
         } else {
             _converse.trigger.apply(_converse, arguments);
             _converse.trigger.apply(_converse, arguments);
         }
         }