Fix join call confirmation

This commit is contained in:
jim3692 2023-03-22 19:09:00 +02:00
parent a9e950ba2f
commit f0f81cc499

View file

@ -10,6 +10,8 @@ import { openNavigation } from '../../../client/action/navigation';
import { getUsername } from '../../../util/matrixUtil';
import Button from '../../atoms/button/Button';
const TOPIC_JITSI_CALL = 'd38dd491fefa1cfffc27f9c57f2bdb4a'
function JitsiRoom(props) {
const { jitsiCallId, setJitsiCallId } = props;
@ -26,26 +28,14 @@ function JitsiRoom(props) {
useEffect(() => {
const handleRoomSelected = (rId, pRoomId, eId) => {
roomInfo.roomTimeline?.removeInternalListeners();
if (mx.getRoom(rId)) {
const roomTimeline = new RoomTimeline(rId);
if (
roomTimeline.room.currentState.getStateEvents('m.room.topic')[0]?.getContent().topic ===
'd38dd491fefa1cfffc27f9c57f2bdb4a' &&
confirm('aaa')
) {
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?')) {
setRoomInfo({
roomTimeline,
eventId: eId ?? null,
});
} else if (
roomTimeline.room.currentState.getStateEvents('m.room.topic')[0]?.getContent().topic !==
'd38dd491fefa1cfffc27f9c57f2bdb4a'
) {
setRoomInfo({
roomTimeline,
eventId: eId ?? null,
});
}
} else {
// TODO: add ability to join room if roomId is invalid
setRoomInfo({