From 3b106f15d9b6bf5e19c6da1c7fb0ab06019f8c03 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 24 Jul 2025 14:30:23 +0200 Subject: [PATCH] review --- src/UrlParams.ts | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 71679771..65e3d901 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -320,37 +320,31 @@ export const getUrlParams = ( : (parser.getEnumParam("intent", UserIntent) ?? UserIntent.Unknown); // Here we only use constants and `platform` to determine the intent preset. let intentPreset: UrlConfiguration; + const inAppDefault = { + confineToRoom: true, + appPrompt: false, + preload: true, + header: platform === "desktop" ? HeaderStyle.None : HeaderStyle.AppBar, + showControls: true, + hideScreensharing: false, + allowIceFallback: true, + perParticipantE2EE: true, + controlledAudioDevices: platform === "desktop" ? false : true, + skipLobby: true, + returnToLobby: false, + sendNotificationType: "notification" as RTCNotificationType, + }; switch (intent) { case UserIntent.StartNewCall: intentPreset = { - confineToRoom: true, - appPrompt: false, - preload: true, - header: platform === "desktop" ? HeaderStyle.None : HeaderStyle.AppBar, - showControls: true, - hideScreensharing: false, - allowIceFallback: true, - perParticipantE2EE: true, - controlledAudioDevices: platform === "desktop" ? false : true, + ...inAppDefault, skipLobby: true, - returnToLobby: false, - sendNotificationType: "notification", }; break; case UserIntent.JoinExistingCall: intentPreset = { - confineToRoom: true, - appPrompt: false, - preload: true, - header: platform === "desktop" ? HeaderStyle.None : HeaderStyle.AppBar, - showControls: true, - hideScreensharing: false, - allowIceFallback: true, - perParticipantE2EE: true, - controlledAudioDevices: platform === "desktop" ? false : true, + ...inAppDefault, skipLobby: false, - returnToLobby: false, - sendNotificationType: undefined, }; break; // Non widget usecase defaults