mirror of https://github.com/vector-im/riot-web
Update MemberList.js
parent
506a798961
commit
d73eb0c70f
|
@ -133,16 +133,21 @@ export default class MemberList extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
get canInvite() {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const room = cli.getRoom(this.props.roomId);
|
||||
return room && room.canInvite(cli.getUserId());
|
||||
}
|
||||
|
||||
_getMembersState(members) {
|
||||
// set the state after determining _showPresence to make sure it's
|
||||
// taken into account while rerendering
|
||||
const cli = MatrixClientPeg.get();
|
||||
return {
|
||||
loading: false,
|
||||
members: members,
|
||||
filteredJoinedMembers: this._filterMembers(members, 'join'),
|
||||
filteredInvitedMembers: this._filterMembers(members, 'invite'),
|
||||
canInvite: cli.getRoom(this.props.roomId).canInvite(cli.getUserId()),
|
||||
canInvite: this.canInvite,
|
||||
|
||||
// ideally we'd size this to the page height, but
|
||||
// in practice I find that a little constraining
|
||||
|
@ -199,9 +204,7 @@ export default class MemberList extends React.Component {
|
|||
this._updateList();
|
||||
}
|
||||
|
||||
const cli = MatrixClientPeg.get();
|
||||
const canInvite = cli.getRoom(this.props.roomId).canInvite(cli.getUserId());
|
||||
if (canInvite !== this.state.canInvite) this.setState({canInvite});
|
||||
if (this.canInvite !== this.state.canInvite) this.setState({ canInvite: this.canInvite });
|
||||
};
|
||||
|
||||
_updateList = rate_limited_func(() => {
|
||||
|
|
Loading…
Reference in New Issue