Backport "Avoid closing the widget in returnToLobby mode" to v0.7

This is a manual backport of 28c45c6107 which makes the video room behavior consistent across the v0.7.2 patch release and development versions.
This commit is contained in:
Robin
2025-03-05 12:30:07 -05:00
parent ac9e7d297b
commit 8225956338
+3
View File
@@ -17,6 +17,7 @@ import {
import { PosthogAnalytics } from "./analytics/PosthogAnalytics"; import { PosthogAnalytics } from "./analytics/PosthogAnalytics";
import { Config } from "./config/Config"; import { Config } from "./config/Config";
import { ElementWidgetActions, WidgetHelpers, widget } from "./widget"; import { ElementWidgetActions, WidgetHelpers, widget } from "./widget";
import { getUrlParams } from "./UrlParams";
const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci"; const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci";
@@ -144,11 +145,13 @@ const widgetPostHangupProcedure = async (
// of Element Call will do, we additionally send a close action (even though // 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 // we're not yet employing the distinction between 'hangup' and 'close' to
// display error screens) // display error screens)
if (!getUrlParams().returnToLobby) {
try { try {
await widget.api.transport.send(ElementWidgetActions.Close, {}); await widget.api.transport.send(ElementWidgetActions.Close, {});
} catch (e) { } catch (e) {
logger.error("Failed to send close action", e); logger.error("Failed to send close action", e);
} }
}
}; };
export async function leaveRTCSession( export async function leaveRTCSession(