knip: remove dead code
This commit is contained in:
@@ -27,11 +27,12 @@ import { ElementWidgetActions, widget } from "../widget";
|
|||||||
import { Config } from "../config/Config";
|
import { Config } from "../config/Config";
|
||||||
import { useUrlParams } from "../UrlParams";
|
import { useUrlParams } from "../UrlParams";
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* If there already are this many participants in the call, we automatically mute
|
// * If there already are this many participants in the call, we automatically mute
|
||||||
* the user.
|
// * the user.
|
||||||
*/
|
// */
|
||||||
export const MUTE_PARTICIPANT_COUNT = 8;
|
// TODO: multi-sfu dead code?
|
||||||
|
// export const MUTE_PARTICIPANT_COUNT = 8;
|
||||||
|
|
||||||
interface DeviceAvailable {
|
interface DeviceAvailable {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2023, 2024 New Vector Ltd.
|
|
||||||
|
|
||||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
||||||
Please see LICENSE in the repository root for full details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
|
||||||
import {
|
|
||||||
type MatrixRTCSession,
|
|
||||||
MatrixRTCSessionEvent,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { TypedEventEmitter } from "matrix-js-sdk";
|
|
||||||
import { useCallback, useEffect } from "react";
|
|
||||||
|
|
||||||
import { useTypedEventEmitterState } from "./useEvents";
|
|
||||||
|
|
||||||
const dummySession = new TypedEventEmitter();
|
|
||||||
|
|
||||||
export function useMatrixRTCSessionJoinState(
|
|
||||||
rtcSession: MatrixRTCSession | undefined,
|
|
||||||
): boolean {
|
|
||||||
// React doesn't allow you to run a hook conditionally, so we have to plug in
|
|
||||||
// a dummy event emitter in case there is no rtcSession yet
|
|
||||||
const isJoined = useTypedEventEmitterState(
|
|
||||||
rtcSession ?? dummySession,
|
|
||||||
MatrixRTCSessionEvent.JoinStateChanged,
|
|
||||||
useCallback(() => rtcSession?.isJoined() ?? false, [rtcSession]),
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
logger.info(
|
|
||||||
`Session in room ${rtcSession?.room.roomId} changed to ${
|
|
||||||
isJoined ? "joined" : "left"
|
|
||||||
}`,
|
|
||||||
);
|
|
||||||
}, [rtcSession, isJoined]);
|
|
||||||
|
|
||||||
return isJoined;
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
mockRtcMembership,
|
mockRtcMembership,
|
||||||
mockMatrixRoomMember,
|
mockMatrixRoomMember,
|
||||||
mockRemoteParticipant,
|
mockRemoteParticipant,
|
||||||
mockLocalParticipant,
|
|
||||||
} from "./test";
|
} from "./test";
|
||||||
|
|
||||||
export const localRtcMember = mockRtcMembership("@carol:example.org", "1111");
|
export const localRtcMember = mockRtcMembership("@carol:example.org", "1111");
|
||||||
@@ -18,7 +17,7 @@ export const localRtcMemberDevice2 = mockRtcMembership(
|
|||||||
"2222",
|
"2222",
|
||||||
);
|
);
|
||||||
export const local = mockMatrixRoomMember(localRtcMember);
|
export const local = mockMatrixRoomMember(localRtcMember);
|
||||||
export const localParticipant = mockLocalParticipant({ identity: "" });
|
// export const localParticipant = mockLocalParticipant({ identity: "" });
|
||||||
export const localId = `${local.userId}:${localRtcMember.deviceId}`;
|
export const localId = `${local.userId}:${localRtcMember.deviceId}`;
|
||||||
|
|
||||||
export const aliceRtcMember = mockRtcMembership("@alice:example.org", "AAAA");
|
export const aliceRtcMember = mockRtcMembership("@alice:example.org", "AAAA");
|
||||||
|
|||||||
Reference in New Issue
Block a user