From 0f97de1b09873e6fc58a75034caf7828646eaa31 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Wed, 23 Mar 2022 18:45:13 +0530 Subject: [PATCH] Fix can't open spaces from public room list (#419) Signed-off-by: Ajay Bura --- src/app/organisms/public-rooms/PublicRooms.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/organisms/public-rooms/PublicRooms.jsx b/src/app/organisms/public-rooms/PublicRooms.jsx index 23401298..467f38d5 100644 --- a/src/app/organisms/public-rooms/PublicRooms.jsx +++ b/src/app/organisms/public-rooms/PublicRooms.jsx @@ -4,7 +4,7 @@ import './PublicRooms.scss'; import initMatrix from '../../../client/initMatrix'; import cons from '../../../client/state/cons'; -import { selectRoom } from '../../../client/action/navigation'; +import { selectRoom, selectTab } from '../../../client/action/navigation'; import * as roomActions from '../../../client/action/room'; import Text from '../../atoms/text/Text'; @@ -179,7 +179,9 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) { }, [joiningRooms]); function handleViewRoom(roomId) { - selectRoom(roomId); + const room = initMatrix.matrixClient.getRoom(roomId); + if (room.isSpaceRoom()) selectTab(roomId); + else selectRoom(roomId); onRequestClose(); } @@ -193,7 +195,7 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) { return rooms.map((room) => { const alias = typeof room.canonical_alias === 'string' ? room.canonical_alias : room.room_id; const name = typeof room.name === 'string' ? room.name : alias; - const isJoined = initMatrix.roomList.rooms.has(room.room_id); + const isJoined = initMatrix.matrixClient.getRoom(room.room_id) !== null; return (