From 51ed7784d5b2851cd3b01ddcb1440db45d16f335 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 26 May 2022 10:03:55 -0400 Subject: [PATCH] Show a dialog when Jitsi encounters an error (#22352) --- src/vector/jitsi/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index c8f4dde126..9270638b7b 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -300,12 +300,12 @@ function createJWTToken() { ); } -async function notifyHangup() { +async function notifyHangup(errorMessage?: string) { if (widgetApi) { // We send the hangup event before setAlwaysOnScreen, because the latter // can cause the receiving side to instantly stop listening. try { - await widgetApi.transport.send(ElementWidgetActions.HangupCall, {}); + await widgetApi.transport.send(ElementWidgetActions.HangupCall, { errorMessage }); } finally { await widgetApi.setAlwaysOnScreen(false); } @@ -418,7 +418,7 @@ function joinConference(audioDevice?: string, videoDevice?: string) { if (error.isFatal) { // We got disconnected. Since Jitsi Meet might send us back to the // prejoin screen, we're forced to act as if we hung up entirely. - notifyHangup(); + notifyHangup(error.message); meetApi = null; closeConference(); }