mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Always stop the widget transport when closing
close() sent io.element.close and then stopped the transport, so a rejected send skipped the stop. Both call sites this replaced stopped it unconditionally — ErrorView in a finally, GroupCallView outside its try/catch — because a host that never acknowledges the request would otherwise leave the messaging live and the close button doing nothing. Restore that with a finally.
This commit is contained in:
+8
-2
@@ -163,8 +163,14 @@ export function createWidgetHostBridge(widget: WidgetHelpers): HostBridge {
|
||||
notifyDeviceMute: async (state) =>
|
||||
send(ElementWidgetActions.DeviceMute, state),
|
||||
close: async () => {
|
||||
await send(ElementWidgetActions.Close);
|
||||
widget.api.transport.stop();
|
||||
try {
|
||||
await send(ElementWidgetActions.Close);
|
||||
} finally {
|
||||
// Stop regardless of whether the host acknowledged the request. A host
|
||||
// that rejects or never answers would otherwise leave the messaging
|
||||
// live, and the close affordance doing nothing at all.
|
||||
widget.api.transport.stop();
|
||||
}
|
||||
},
|
||||
themeChange$: requests(WidgetApiToWidgetAction.ThemeChange),
|
||||
join$: requests(ElementWidgetActions.JoinCall),
|
||||
|
||||
Reference in New Issue
Block a user