Fix re-enter jitsi call

This commit is contained in:
jim3692 2023-03-22 19:53:19 +02:00
parent 2d25d0f916
commit b34de2c79d

View file

@ -31,17 +31,18 @@ function JitsiRoom(props) {
const roomTimeline = new RoomTimeline(rId); const roomTimeline = new RoomTimeline(rId);
const topic = roomTimeline.room.currentState.getStateEvents('m.room.topic')[0]?.getContent().topic const topic = roomTimeline.room.currentState.getStateEvents('m.room.topic')[0]?.getContent().topic
if (mx.getRoom(rId) && topic === TOPIC_JITSI_CALL && confirm('Do you want to join this call?')) { if (mx.getRoom(rId) && topic === TOPIC_JITSI_CALL) {
setRoomInfo({ if (confirm('Do you want to join this call?')) {
roomTimeline, setRoomInfo({
eventId: eId ?? null, roomTimeline,
}); eventId: eId ?? null,
} else { });
// TODO: add ability to join room if roomId is invalid } else if (!jitsiCallId) {
setRoomInfo({ setRoomInfo({
roomTimeline: null, roomTimeline: null,
eventId: null, eventId: null,
}); });
}
} }
}; };
@ -80,6 +81,10 @@ function JitsiRoom(props) {
onClick={() => { onClick={() => {
setJitsiCallId(null); setJitsiCallId(null);
setRoomName(''); setRoomName('');
setRoomInfo({
roomTimeline: null,
eventId: null,
});
}} }}
> >
X X