From 82259563388e102a0fb916cc5743db4b4f63c26d Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 5 Mar 2025 12:30:07 -0500 Subject: [PATCH] Backport "Avoid closing the widget in returnToLobby mode" to v0.7 This is a manual backport of 28c45c61072126023381446877fb99c4c36fd8ac which makes the video room behavior consistent across the v0.7.2 patch release and development versions. --- src/rtcSessionHelpers.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 1bf9dda9..94c4818a 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -17,6 +17,7 @@ import { import { PosthogAnalytics } from "./analytics/PosthogAnalytics"; import { Config } from "./config/Config"; import { ElementWidgetActions, WidgetHelpers, widget } from "./widget"; +import { getUrlParams } from "./UrlParams"; const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci"; @@ -144,10 +145,12 @@ const widgetPostHangupProcedure = async ( // of Element Call will do, we additionally send a close action (even though // we're not yet employing the distinction between 'hangup' and 'close' to // display error screens) - try { - await widget.api.transport.send(ElementWidgetActions.Close, {}); - } catch (e) { - logger.error("Failed to send close action", e); + if (!getUrlParams().returnToLobby) { + try { + await widget.api.transport.send(ElementWidgetActions.Close, {}); + } catch (e) { + logger.error("Failed to send close action", e); + } } };