mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-09 18:29:21 +00:00
@@ -228,7 +228,7 @@ export interface UrlConfiguration {
|
|||||||
*/
|
*/
|
||||||
waitForCallPickup: boolean;
|
waitForCallPickup: boolean;
|
||||||
}
|
}
|
||||||
interface IntentDerivedConfiguration {
|
interface IntentAndPlatformDerivedConfiguration {
|
||||||
defaultAudioEnabled?: boolean;
|
defaultAudioEnabled?: boolean;
|
||||||
defaultVideoEnabled?: boolean;
|
defaultVideoEnabled?: boolean;
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,7 @@ interface IntentDerivedConfiguration {
|
|||||||
export interface UrlParams
|
export interface UrlParams
|
||||||
extends UrlProperties,
|
extends UrlProperties,
|
||||||
UrlConfiguration,
|
UrlConfiguration,
|
||||||
IntentDerivedConfiguration {}
|
IntentAndPlatformDerivedConfiguration {}
|
||||||
|
|
||||||
// This is here as a stopgap, but what would be far nicer is a function that
|
// 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
|
// 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";
|
const desktopMobile = platform === "desktop" ? "desktop" : "mobile";
|
||||||
switch (desktopMobile) {
|
switch (desktopMobile) {
|
||||||
case "desktop":
|
case "desktop":
|
||||||
@@ -415,8 +417,8 @@ export const getUrlParams = (
|
|||||||
case UserIntent.JoinExistingCall:
|
case UserIntent.JoinExistingCall:
|
||||||
case UserIntent.StartNewCallDM:
|
case UserIntent.StartNewCallDM:
|
||||||
case UserIntent.JoinExistingCallDM:
|
case UserIntent.JoinExistingCallDM:
|
||||||
intentDerivedConfiguration.defaultAudioEnabled = true;
|
intentAndPlatformDerivedConfiguration.defaultAudioEnabled = true;
|
||||||
intentDerivedConfiguration.defaultVideoEnabled = true;
|
intentAndPlatformDerivedConfiguration.defaultVideoEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -477,7 +479,7 @@ export const getUrlParams = (
|
|||||||
...properties,
|
...properties,
|
||||||
...intentPreset,
|
...intentPreset,
|
||||||
...pickBy(configuration, (v?: unknown) => v !== undefined),
|
...pickBy(configuration, (v?: unknown) => v !== undefined),
|
||||||
...intentDerivedConfiguration,
|
...intentAndPlatformDerivedConfiguration,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ function mockMediaDevices(
|
|||||||
return new MediaDevices(scope);
|
return new MediaDevices(scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("useMuteStates in full mode", () => {
|
describe("useMuteStates VITE_PACKAGE='full' (SPA) mode", () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
vi.stubEnv("VITE_PACKAGE", "full");
|
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(() => {
|
beforeEach(() => {
|
||||||
vi.stubEnv("VITE_PACKAGE", "embedded");
|
vi.stubEnv("VITE_PACKAGE", "embedded");
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user