Fix crash on invite from dendrite hs (#453)

This commit is contained in:
Ajay Bura 2022-04-24 17:10:18 +05:30
parent 87f3afd8fd
commit 44c3dec9dc

View file

@ -54,17 +54,19 @@ function InviteList({ isOpen, onRequestClose }) {
}, [procInvite]);
function renderRoomTile(roomId) {
const myRoom = initMatrix.matrixClient.getRoom(roomId);
const mx = initMatrix.matrixClient;
const myRoom = mx.getRoom(roomId);
const roomName = myRoom.name;
let roomAlias = myRoom.getCanonicalAlias();
if (roomAlias === null) roomAlias = myRoom.roomId;
const inviterName = myRoom.getMember(mx.getUserId())?.events?.member?.getSender?.() ?? '';
return (
<RoomTile
key={myRoom.roomId}
name={roomName}
avatarSrc={initMatrix.matrixClient.getRoom(roomId).getAvatarUrl(initMatrix.matrixClient.baseUrl, 42, 42, 'crop')}
id={roomAlias}
inviterName={myRoom.getJoinedMembers()[0].userId}
inviterName={inviterName}
options={
procInvite.has(myRoom.roomId)
? (<Spinner size="small" />)