Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-09-18 12:34:21 +02:00
parent dc5203a8fe
commit de52ea2dd2
2 changed files with 10 additions and 8 deletions

View File

@@ -228,7 +228,7 @@ export interface UrlConfiguration {
*/
waitForCallPickup: boolean;
}
interface IntentDerivedConfiguration {
interface IntentAndPlatformDerivedConfiguration {
defaultAudioEnabled?: boolean;
defaultVideoEnabled?: boolean;
}
@@ -241,7 +241,7 @@ interface IntentDerivedConfiguration {
export interface UrlParams
extends UrlProperties,
UrlConfiguration,
IntentDerivedConfiguration {}
IntentAndPlatformDerivedConfiguration {}
// This is here as a stopgap, but what would be far nicer is a function that
// takes a UrlParams and returns a query string. That would enable us to
@@ -405,7 +405,9 @@ export const getUrlParams = (
};
}
const intentDerivedConfiguration: IntentDerivedConfiguration = {};
const intentAndPlatformDerivedConfiguration: IntentAndPlatformDerivedConfiguration =
{};
// Desktop also includes web. Its anything that is not mobile.
const desktopMobile = platform === "desktop" ? "desktop" : "mobile";
switch (desktopMobile) {
case "desktop":
@@ -415,8 +417,8 @@ export const getUrlParams = (
case UserIntent.JoinExistingCall:
case UserIntent.StartNewCallDM:
case UserIntent.JoinExistingCallDM:
intentDerivedConfiguration.defaultAudioEnabled = true;
intentDerivedConfiguration.defaultVideoEnabled = true;
intentAndPlatformDerivedConfiguration.defaultAudioEnabled = true;
intentAndPlatformDerivedConfiguration.defaultVideoEnabled = true;
break;
}
}
@@ -477,7 +479,7 @@ export const getUrlParams = (
...properties,
...intentPreset,
...pickBy(configuration, (v?: unknown) => v !== undefined),
...intentDerivedConfiguration,
...intentAndPlatformDerivedConfiguration,
};
};

View File

@@ -110,7 +110,7 @@ function mockMediaDevices(
return new MediaDevices(scope);
}
describe("useMuteStates in full mode", () => {
describe("useMuteStates VITE_PACKAGE='full' (SPA) mode", () => {
afterEach(() => {
vi.clearAllMocks();
vi.stubEnv("VITE_PACKAGE", "full");
@@ -258,7 +258,7 @@ describe("useMuteStates in full mode", () => {
});
});
describe("useMuteStates in embedded mode", () => {
describe("useMuteStates in VITE_PACKAGE='embedded' (widget) mode", () => {
beforeEach(() => {
vi.stubEnv("VITE_PACKAGE", "embedded");
});