Commit 2f5cc3b2 authored by JC Brand's avatar JC Brand

Bugfix. Make sure arguments are passed to all triggered events

parent 11023dfe
...@@ -439,7 +439,8 @@ export const api = _converse.api = { ...@@ -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);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment