fix: listenAction must reply to prevent widget transport timeout
Previously the listenAction wrapper only called preventDefault() to stop
the switch default from firing an error, but it never sent a reply.
The widget transport would then wait for a response until it timed out.
Now the wrapper also calls transport.reply(ev.detail, {}) to return an
immediate success, fixing io.element.join, io.element.device_mute, and
set_always_on_screen.
This commit is contained in:
@@ -467,6 +467,8 @@ export class CallEmbed {
|
||||
public listenAction<T>(type: string, callback: (event: CustomEvent<T>) => void) {
|
||||
const wrapped = (ev: CustomEvent<T>) => {
|
||||
ev.preventDefault();
|
||||
// Reply with success so the widget transport doesn't time out waiting for a response
|
||||
this.call.transport.reply(ev.detail as any, {});
|
||||
callback(ev);
|
||||
};
|
||||
return this.listenEvent(`action:${type}`, wrapped);
|
||||
|
||||
Reference in New Issue
Block a user