Fix navigating outside of current space when a call is active
This commit is contained in:
parent
df538c2b2b
commit
70e9d9254d
1 changed files with 11 additions and 6 deletions
|
@ -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
|
if (mx.getRoom(rId)) {
|
||||||
|
roomTimeline = new RoomTimeline(rId);
|
||||||
|
topic = roomTimeline.room?.currentState
|
||||||
.getStateEvents('m.room.topic')[0]
|
.getStateEvents('m.room.topic')[0]
|
||||||
?.getContent().topic;
|
?.getContent().topic;
|
||||||
|
}
|
||||||
|
|
||||||
if (mx.getRoom(rId) && topic === TOPIC_JITSI_CALL && jitsiCallId !== rId) {
|
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', '')}`}
|
||||||
|
|
Loading…
Reference in a new issue