mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-22 22:29:30 +00:00
rename useMatrixRtc -> userRustRtcSdk
This commit is contained in:
@@ -203,13 +203,13 @@ const LoadedCallView: FC<LoadedProps> = ({
|
|||||||
effectiveCallViewModelImplementation(),
|
effectiveCallViewModelImplementation(),
|
||||||
);
|
);
|
||||||
// this is the rustsdkmatrix rtc. So we should call it useRustRtcSdk
|
// this is the rustsdkmatrix rtc. So we should call it useRustRtcSdk
|
||||||
const useMatrixRtc =
|
const useRustRtcSdk =
|
||||||
implementation === CallViewModelImplementation.MatrixRtc ||
|
implementation === CallViewModelImplementation.MatrixRtc ||
|
||||||
rtcSession === undefined;
|
rtcSession === undefined;
|
||||||
// Sampled once, like the implementation: the participation is the call,
|
// Sampled once, like the implementation: the participation is the call,
|
||||||
// and rebuilding it for a later change of these would leave and rejoin.
|
// and rebuilding it for a later change of these would leave and rejoin.
|
||||||
const [participationConfigValue] = useState(() =>
|
const [participationConfigValue] = useState(() =>
|
||||||
useMatrixRtc
|
useRustRtcSdk
|
||||||
? participationConfig({
|
? participationConfig({
|
||||||
// matrix_rtc_mode in config.json overrides the user's choice.
|
// matrix_rtc_mode in config.json overrides the user's choice.
|
||||||
mode:
|
mode:
|
||||||
@@ -221,7 +221,7 @@ const LoadedCallView: FC<LoadedProps> = ({
|
|||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
const rtcParticipationManager = useRtcParticipationManager(
|
const rtcParticipationManager = useRtcParticipationManager(
|
||||||
useMatrixRtc ? drivers : null,
|
useRustRtcSdk ? drivers : null,
|
||||||
participationConfigValue,
|
participationConfigValue,
|
||||||
);
|
);
|
||||||
const participationMemberships = useBehavior(
|
const participationMemberships = useBehavior(
|
||||||
@@ -230,10 +230,10 @@ const LoadedCallView: FC<LoadedProps> = ({
|
|||||||
// The call's members, whichever side lists them; only who they are matters here.
|
// The call's members, whichever side lists them; only who they are matters here.
|
||||||
const memberUserIds = useMemo(
|
const memberUserIds = useMemo(
|
||||||
() =>
|
() =>
|
||||||
useMatrixRtc
|
useRustRtcSdk
|
||||||
? participationMemberships.value.map((m) => m.member.userId)
|
? participationMemberships.value.map((m) => m.member.userId)
|
||||||
: jsSdkMemberships.map((m) => m.userId!),
|
: jsSdkMemberships.map((m) => m.userId!),
|
||||||
[useMatrixRtc, participationMemberships, jsSdkMemberships],
|
[useRustRtcSdk, participationMemberships, jsSdkMemberships],
|
||||||
);
|
);
|
||||||
const rootElement = useRootElement();
|
const rootElement = useRootElement();
|
||||||
const hostBridge = useHostBridge();
|
const hostBridge = useHostBridge();
|
||||||
@@ -256,11 +256,11 @@ const LoadedCallView: FC<LoadedProps> = ({
|
|||||||
const mutedForCallSize = useRef(false);
|
const mutedForCallSize = useRef(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mutedForCallSize.current) return;
|
if (mutedForCallSize.current) return;
|
||||||
if (useMatrixRtc && !participationMemberships.value.length) return;
|
if (useRustRtcSdk && !participationMemberships.value.length) return;
|
||||||
mutedForCallSize.current = true;
|
mutedForCallSize.current = true;
|
||||||
if (memberUserIds.length >= MUTE_PARTICIPANT_COUNT)
|
if (memberUserIds.length >= MUTE_PARTICIPANT_COUNT)
|
||||||
muteStates.audio.setEnabled$.value?.(false);
|
muteStates.audio.setEnabled$.value?.(false);
|
||||||
}, [useMatrixRtc, participationMemberships, memberUserIds, muteStates]);
|
}, [useRustRtcSdk, participationMemberships, memberUserIds, muteStates]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
logger.info("[Lifecycle] CallView Component mounted");
|
logger.info("[Lifecycle] CallView Component mounted");
|
||||||
@@ -628,7 +628,7 @@ const LoadedCallView: FC<LoadedProps> = ({
|
|||||||
throw externalError;
|
throw externalError;
|
||||||
};
|
};
|
||||||
body = <ErrorComponent />;
|
body = <ErrorComponent />;
|
||||||
} else if (joined && useMatrixRtc && rtcParticipationManager === null) {
|
} else if (joined && useRustRtcSdk && rtcParticipationManager === null) {
|
||||||
// Joined before the crate is ready (its wasm loads on first use): the
|
// Joined before the crate is ready (its wasm loads on first use): the
|
||||||
// call appears with the participation manager, a render later.
|
// call appears with the participation manager, a render later.
|
||||||
body = null;
|
body = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user