Fix can't open spaces from public room list (#419)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
e8d6ccec9a
commit
0f97de1b09
1 changed files with 5 additions and 3 deletions
|
@ -4,7 +4,7 @@ import './PublicRooms.scss';
|
||||||
|
|
||||||
import initMatrix from '../../../client/initMatrix';
|
import initMatrix from '../../../client/initMatrix';
|
||||||
import cons from '../../../client/state/cons';
|
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 * as roomActions from '../../../client/action/room';
|
||||||
|
|
||||||
import Text from '../../atoms/text/Text';
|
import Text from '../../atoms/text/Text';
|
||||||
|
@ -179,7 +179,9 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
|
||||||
}, [joiningRooms]);
|
}, [joiningRooms]);
|
||||||
|
|
||||||
function handleViewRoom(roomId) {
|
function handleViewRoom(roomId) {
|
||||||
selectRoom(roomId);
|
const room = initMatrix.matrixClient.getRoom(roomId);
|
||||||
|
if (room.isSpaceRoom()) selectTab(roomId);
|
||||||
|
else selectRoom(roomId);
|
||||||
onRequestClose();
|
onRequestClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +195,7 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
|
||||||
return rooms.map((room) => {
|
return rooms.map((room) => {
|
||||||
const alias = typeof room.canonical_alias === 'string' ? room.canonical_alias : room.room_id;
|
const alias = typeof room.canonical_alias === 'string' ? room.canonical_alias : room.room_id;
|
||||||
const name = typeof room.name === 'string' ? room.name : alias;
|
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 (
|
return (
|
||||||
<RoomTile
|
<RoomTile
|
||||||
key={room.room_id}
|
key={room.room_id}
|
||||||
|
|
Loading…
Reference in a new issue