prettier format
This commit is contained in:
@@ -252,10 +252,7 @@ export interface UrlConfiguration {
|
||||
// the situations that call for this behavior ('isEmbedded'). This makes it
|
||||
// clearer what each flag means, and helps us avoid coupling Element Call's
|
||||
// behavior to the needs of specific consumers.
|
||||
export interface UrlParams
|
||||
extends
|
||||
UrlProperties,
|
||||
UrlConfiguration {}
|
||||
export interface UrlParams extends UrlProperties, UrlConfiguration {}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -71,7 +71,17 @@ export const RoomPage: FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const scope = new ObservableScope();
|
||||
setMuteStates(new MuteStates(scope, devices, calculateInitialMuteState(urlParams, import.meta.env.VITE_PACKAGE, window.location.hostname)));
|
||||
setMuteStates(
|
||||
new MuteStates(
|
||||
scope,
|
||||
devices,
|
||||
calculateInitialMuteState(
|
||||
urlParams,
|
||||
import.meta.env.VITE_PACKAGE,
|
||||
window.location.hostname,
|
||||
),
|
||||
),
|
||||
);
|
||||
return (): void => scope.end();
|
||||
}, [devices, urlParams]);
|
||||
|
||||
|
||||
@@ -48,12 +48,7 @@ describe("MuteState", () => {
|
||||
select(): void {},
|
||||
} as unknown as MediaDevice<DeviceLabel, SelectedDevice>;
|
||||
|
||||
const muteState = new MuteState(
|
||||
testScope,
|
||||
deviceStub,
|
||||
true,
|
||||
forceMute$,
|
||||
);
|
||||
const muteState = new MuteState(testScope, deviceStub, true, forceMute$);
|
||||
let lastEnabled: boolean = false;
|
||||
muteState.enabled$.subscribe((enabled) => {
|
||||
lastEnabled = enabled;
|
||||
@@ -162,14 +157,10 @@ describe("MuteStates", () => {
|
||||
videoInput: aVideoInput(),
|
||||
// other devices are not relevant for this test
|
||||
});
|
||||
const muteStates = new MuteStates(
|
||||
testScope,
|
||||
mediaDevices,
|
||||
{
|
||||
audioEnabled: false,
|
||||
videoEnabled: false,
|
||||
}
|
||||
);
|
||||
const muteStates = new MuteStates(testScope, mediaDevices, {
|
||||
audioEnabled: false,
|
||||
videoEnabled: false,
|
||||
});
|
||||
|
||||
let latestSyncedState: boolean | null = null;
|
||||
muteStates.video.setHandler(async (enabled: boolean): Promise<boolean> => {
|
||||
|
||||
@@ -10,7 +10,6 @@ import { type RTCCallIntent } from "matrix-js-sdk/lib/matrixrtc";
|
||||
|
||||
import { calculateInitialMuteState } from "./initialMuteState";
|
||||
|
||||
|
||||
test.each<{
|
||||
callIntent: RTCCallIntent;
|
||||
packageType: "full" | "embedded";
|
||||
@@ -69,7 +68,6 @@ test.each<{
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
test.each<{
|
||||
isDevBuild: boolean;
|
||||
currentHost: string;
|
||||
@@ -78,11 +76,14 @@ test.each<{
|
||||
{ isDevBuild: true, currentHost: "localhost", expectedEnabled: true },
|
||||
{ isDevBuild: false, currentHost: "localhost", expectedEnabled: false },
|
||||
{ isDevBuild: true, currentHost: "call.example.com", expectedEnabled: false },
|
||||
{ isDevBuild: false, currentHost: "call.example.com", expectedEnabled: false },
|
||||
])
|
||||
("Should trust localhost domain when in dev mode isDevBuild($isDevBuild) host($currentHost)", (
|
||||
{isDevBuild, currentHost, expectedEnabled}
|
||||
) => {
|
||||
{
|
||||
isDevBuild: false,
|
||||
currentHost: "call.example.com",
|
||||
expectedEnabled: false,
|
||||
},
|
||||
])(
|
||||
"Should trust localhost domain when in dev mode isDevBuild($isDevBuild) host($currentHost)",
|
||||
({ isDevBuild, currentHost, expectedEnabled }) => {
|
||||
const { audioEnabled, videoEnabled } = calculateInitialMuteState(
|
||||
{ skipLobby: true, callIntent: "video" },
|
||||
"full",
|
||||
@@ -92,4 +93,5 @@ test.each<{
|
||||
|
||||
expect(audioEnabled).toBe(expectedEnabled);
|
||||
expect(videoEnabled).toBe(expectedEnabled);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -525,5 +525,8 @@ export function mockMuteStates(
|
||||
joined$: Observable<boolean> = of(true),
|
||||
): MuteStates {
|
||||
const observableScope = new ObservableScope();
|
||||
return new MuteStates(observableScope, mockMediaDevices({}), { audioEnabled: false, videoEnabled: false });
|
||||
return new MuteStates(observableScope, mockMediaDevices({}), {
|
||||
audioEnabled: false,
|
||||
videoEnabled: false,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user