Merge remote-tracking branch 'origin/develop' into develop

pull/21833/head
Weblate 2017-10-24 10:18:07 +00:00
commit e9eb4a4647
1 changed files with 12 additions and 6 deletions

View File

@ -59,6 +59,7 @@ export default withMatrixClient(React.createClass({
},
_fetchMembers: function() {
if (this._unmounted) return;
this.setState({
members: this._groupStore.getGroupMembers(),
invitedMembers: this._groupStore.getGroupInvitedMembers(),
@ -105,12 +106,11 @@ export default withMatrixClient(React.createClass({
});
}
memberList = memberList.map((m) => {
return (
<GroupMemberTile key={m.userId} groupId={this.props.groupId} member={m} />
);
const uniqueMembers = {};
memberList.forEach((m) => {
if (!uniqueMembers[m.userId]) uniqueMembers[m.userId] = m;
});
memberList = Object.keys(uniqueMembers).map((userId) => uniqueMembers[userId]);
memberList.sort((a, b) => {
// TODO: should put admins at the top: we don't yet have that info
if (a < b) {
@ -122,10 +122,16 @@ export default withMatrixClient(React.createClass({
}
});
const memberTiles = memberList.map((m) => {
return (
<GroupMemberTile key={m.userId} groupId={this.props.groupId} member={m} />
);
});
return <TruncatedList className="mx_MemberList_wrapper" truncateAt={this.state.truncateAt}
createOverflowElement={this._createOverflowTile}
>
{ memberList }
{ memberTiles }
</TruncatedList>;
},