mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
This commit is contained in:
parent
5e407b44b7
commit
9d3b0f6075
1 changed files with 12 additions and 10 deletions
|
@ -35,21 +35,23 @@ var invite_defer = q.defer();
|
|||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'MemberList',
|
||||
|
||||
getInitialState: function() {
|
||||
if (!this.props.roomId) return { members: [] };
|
||||
var cli = MatrixClientPeg.get();
|
||||
var room = cli.getRoom(this.props.roomId);
|
||||
if (!room) return { members: [] };
|
||||
|
||||
this.memberDict = this.getMemberDict();
|
||||
|
||||
var members = this.roomMembers(INITIAL_LOAD_NUM_MEMBERS);
|
||||
return {
|
||||
members: members,
|
||||
var state = {
|
||||
members: [],
|
||||
// ideally we'd size this to the page height, but
|
||||
// in practice I find that a little constraining
|
||||
truncateAt: INITIAL_LOAD_NUM_MEMBERS,
|
||||
};
|
||||
if (!this.props.roomId) return state;
|
||||
var cli = MatrixClientPeg.get();
|
||||
var room = cli.getRoom(this.props.roomId);
|
||||
if (!room) return state;
|
||||
|
||||
this.memberDict = this.getMemberDict();
|
||||
|
||||
state.members = this.roomMembers(INITIAL_LOAD_NUM_MEMBERS);
|
||||
return state;
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
|
|
Loading…
Reference in a new issue