Fix navigating outside of current space when a call is active

This commit is contained in:
IceDBorn 2023-03-25 21:30:11 +02:00
parent df538c2b2b
commit 70e9d9254d

View file

@ -29,13 +29,18 @@ function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId })
useEffect(() => { useEffect(() => {
const handleRoomSelected = (rId, pRoomId, eId) => { const handleRoomSelected = (rId, pRoomId, eId) => {
let topic = '';
let roomTimeline = null;
roomInfo.roomTimeline?.removeInternalListeners(); roomInfo.roomTimeline?.removeInternalListeners();
const roomTimeline = new RoomTimeline(rId);
const topic = roomTimeline.room.currentState
.getStateEvents('m.room.topic')[0]
?.getContent().topic;
if (mx.getRoom(rId) && topic === TOPIC_JITSI_CALL && jitsiCallId !== rId) { if (mx.getRoom(rId)) {
roomTimeline = new RoomTimeline(rId);
topic = roomTimeline.room?.currentState
.getStateEvents('m.room.topic')[0]
?.getContent().topic;
}
if (topic === TOPIC_JITSI_CALL && jitsiCallId !== rId) {
setJitsiCallId(rId); setJitsiCallId(rId);
setRoomName(roomTimeline.roomName); setRoomName(roomTimeline.roomName);
setRoomInfo({ setRoomInfo({
@ -93,7 +98,7 @@ function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId })
<JitsiMeeting <JitsiMeeting
key={counter} key={counter}
domain="meet.calyx.net" domain="meet.calyx.net"
roomName={`${roomName.replace(':', '')} ${spaceName.replace( roomName={`${roomName.replace(':', '')} ${spaceName?.replace(
':', ':',
'' ''
)} ${roomTimeline.roomId.replace(':matrix.org', '')}`} )} ${roomTimeline.roomId.replace(':matrix.org', '')}`}