mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-28 06:50:26 +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) {
|
||||
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,
|
||||
)?.[0];
|
||||
if (!targetUser) {
|
||||
|
||||
@@ -96,6 +96,7 @@ import {
|
||||
useSetting,
|
||||
} from "../settings/settings";
|
||||
import useReactionsReader from "../reactions/useReactionsReader";
|
||||
import { useLatest } from "../useLatest";
|
||||
|
||||
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
|
||||
|
||||
@@ -129,17 +130,18 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const reader = useReactionsReader(props.rtcSession);
|
||||
const reader = useLatest(useReactionsReader(props.rtcSession));
|
||||
|
||||
useEffect(() => {
|
||||
if (livekitRoom !== undefined && reader !== undefined) {
|
||||
console.log("Creating new VM");
|
||||
const vm = new CallViewModel(
|
||||
props.rtcSession,
|
||||
livekitRoom,
|
||||
props.e2eeSystem,
|
||||
connStateObservable,
|
||||
reader.raisedHands,
|
||||
reader.reactions,
|
||||
reader.current.raisedHands,
|
||||
reader.current.reactions,
|
||||
);
|
||||
setVm(vm);
|
||||
return (): void => vm.destroy();
|
||||
|
||||
Reference in New Issue
Block a user