diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 965b706f..a88d1126 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -80,15 +80,13 @@ export const GroupCallView: FC = ({ const memberships = useMatrixRTCSessionMemberships(rtcSession); const isJoined = useMatrixRTCSessionJoinState(rtcSession); - // this should be useEffectEvent (only available in experimental versions) - const participantMuteOnce = useCallback(() => { + // This should use `useEffectEvent` (only available in experimental versions) + useEffect(() => { if (memberships.length >= MUTE_PARTICIPANT_COUNT) muteStates.audio.setEnabled?.(false); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - useEffect(() => participantMuteOnce(), [participantMuteOnce]); - useEffect(() => { window.rtcSession = rtcSession; return (): void => {