From 59375f02b8e18df2f8da37870e6569eefa8e69ec Mon Sep 17 00:00:00 2001 From: CrazyStevenz Date: Sat, 25 Mar 2023 22:43:25 +0200 Subject: [PATCH] Fix space name in jitsi room header --- src/app/organisms/room/JitsiRoom.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/organisms/room/JitsiRoom.jsx b/src/app/organisms/room/JitsiRoom.jsx index 5a12f484..45d10bd7 100644 --- a/src/app/organisms/room/JitsiRoom.jsx +++ b/src/app/organisms/room/JitsiRoom.jsx @@ -13,7 +13,7 @@ import { getUsername } from '../../../util/matrixUtil'; import Button from '../../atoms/button/Button'; import { useSelectedSpace } from '../../hooks/useSelectedSpace'; -const TOPIC_JITSI_CALL = 'd38dd491fefa1cfffc27f9c57f2bdb4a' +const TOPIC_JITSI_CALL = 'd38dd491fefa1cfffc27f9c57f2bdb4a'; function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId }) { const [roomInfo, setRoomInfo] = useState({ @@ -21,11 +21,11 @@ function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId }) eventId: null, }); const [roomName, setRoomName] = useState(''); + const [spaceName, setSpaceName] = useState(null); const [counter, setCounter] = useState(0); - const openerRef = useRef(null); const mx = initMatrix.matrixClient; - const spaceName = mx.getRoom(useSelectedSpace())?.name; + const sn = mx.getRoom(useSelectedSpace())?.name; useEffect(() => { const handleRoomSelected = (rId, pRoomId, eId) => { @@ -43,20 +43,19 @@ function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId }) if (topic === TOPIC_JITSI_CALL && jitsiCallId !== rId) { setJitsiCallId(rId); setRoomName(roomTimeline.roomName); + setSpaceName(sn); setRoomInfo({ roomTimeline, eventId: eId ?? null, }); setCounter(counter + 1); - } - else if (!jitsiCallId) { + } else if (!jitsiCallId) { setRoomInfo({ roomTimeline: null, eventId: null, }); } - setIsJitsiRoom(topic === TOPIC_JITSI_CALL); }; @@ -76,13 +75,14 @@ function JitsiRoom({ isJitsiRoom, setIsJitsiRoom, jitsiCallId, setJitsiCallId }) return (
-
- {roomName} ({spaceName}) +
+ {roomName} ({spaceName || sn})