Update src/components/views/rooms/RoomTile.tsx

pull/21833/head
Jaiwanth 2021-03-19 22:46:19 +05:30
parent 70e0b77fc4
commit 495cbadb08
1 changed files with 1 additions and 9 deletions

View File

@ -464,16 +464,8 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
const isLowPriority = roomTags.includes(DefaultTagID.LowPriority);
const lowPriorityLabel = _t("Low Priority");
const inRoom = this.props.room.getMyMembership() === "join";
const userId = MatrixClientPeg.get().getUserId();
let canInvite = inRoom;
const powerLevels = this.props.room.currentState
.getStateEvents("m.room.power_levels", "")
?.getContent();
const me = this.props.room.getMember(userId);
if (powerLevels && me && powerLevels.invite > me.powerLevel) {
canInvite = false;
}
const canInvite = this.props.room.canInvite(userId);
contextMenu = <IconizedContextMenu
{...contextMenuBelow(this.state.generalMenuPosition)}
onFinished={this.onCloseGeneralMenu}