mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-18 18:59:23 +00:00
fix a couple of bugs
This commit is contained in:
@@ -245,7 +245,7 @@ export default function useReactionsReader(rtcSession: MatrixRTCSession): {
|
|||||||
}
|
}
|
||||||
} else if (event.getType() === EventType.RoomRedaction) {
|
} else if (event.getType() === EventType.RoomRedaction) {
|
||||||
const targetEvent = event.event.redacts;
|
const targetEvent = event.event.redacts;
|
||||||
const targetUser = Object.entries(latestRaisedHands.current).find(
|
const targetUser = Object.entries(latestRaisedHands.current.value).find(
|
||||||
([_u, r]) => r.reactionEventId === targetEvent,
|
([_u, r]) => r.reactionEventId === targetEvent,
|
||||||
)?.[0];
|
)?.[0];
|
||||||
if (!targetUser) {
|
if (!targetUser) {
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ import {
|
|||||||
useSetting,
|
useSetting,
|
||||||
} from "../settings/settings";
|
} from "../settings/settings";
|
||||||
import useReactionsReader from "../reactions/useReactionsReader";
|
import useReactionsReader from "../reactions/useReactionsReader";
|
||||||
|
import { useLatest } from "../useLatest";
|
||||||
|
|
||||||
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
|
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
|
||||||
|
|
||||||
@@ -129,17 +130,18 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const reader = useReactionsReader(props.rtcSession);
|
const reader = useLatest(useReactionsReader(props.rtcSession));
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (livekitRoom !== undefined && reader !== undefined) {
|
if (livekitRoom !== undefined && reader !== undefined) {
|
||||||
|
console.log("Creating new VM");
|
||||||
const vm = new CallViewModel(
|
const vm = new CallViewModel(
|
||||||
props.rtcSession,
|
props.rtcSession,
|
||||||
livekitRoom,
|
livekitRoom,
|
||||||
props.e2eeSystem,
|
props.e2eeSystem,
|
||||||
connStateObservable,
|
connStateObservable,
|
||||||
reader.raisedHands,
|
reader.current.raisedHands,
|
||||||
reader.reactions,
|
reader.current.reactions,
|
||||||
);
|
);
|
||||||
setVm(vm);
|
setVm(vm);
|
||||||
return (): void => vm.destroy();
|
return (): void => vm.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user