From f79e2eae40b75a87702e6dfcc7bcdb9176b6b4ef Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 25 Jul 2018 12:39:46 +0200 Subject: [PATCH] might not have loaded members here yet --- src/components/views/rooms/RoomPreviewBar.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index 64c9b376df..5ec19d185e 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -98,11 +98,11 @@ module.exports = React.createClass({ ); } - const myMember = this.props.room ? this.props.room.currentState.members[ - MatrixClientPeg.get().credentials.userId - ] : null; - const kicked = myMember.isKicked(); - const banned = myMember && myMember.membership == 'ban'; + const myMember = this.props.room ? + this.props.room.getMember(MatrixClientPeg.get().getUserId()) : + null; + const kicked = myMember && myMember.isKicked(); + const banned = myMember && myMember && myMember.membership == 'ban'; if (this.props.inviterName) { let emailMatchBlock;