Order users in the group member list with admins first
This commit is contained in:
parent
c1d9d3714a
commit
e3e161fbea
1 changed files with 2 additions and 8 deletions
|
@ -108,15 +108,9 @@ export default withMatrixClient(React.createClass({
|
||||||
if (!uniqueMembers[m.userId]) uniqueMembers[m.userId] = m;
|
if (!uniqueMembers[m.userId]) uniqueMembers[m.userId] = m;
|
||||||
});
|
});
|
||||||
memberList = Object.keys(uniqueMembers).map((userId) => uniqueMembers[userId]);
|
memberList = Object.keys(uniqueMembers).map((userId) => uniqueMembers[userId]);
|
||||||
|
// Descending sort on isPrivileged = true = 1 to isPrivileged = false = 0
|
||||||
memberList.sort((a, b) => {
|
memberList.sort((a, b) => {
|
||||||
// TODO: should put admins at the top: we don't yet have that info
|
return b.isPrivileged - a.isPrivileged;
|
||||||
if (a < b) {
|
|
||||||
return -1;
|
|
||||||
} else if (a > b) {
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const memberTiles = memberList.map((m) => {
|
const memberTiles = memberList.map((m) => {
|
||||||
|
|
Loading…
Reference in a new issue