mirror of https://github.com/vector-im/riot-web
take null last_active_ago values into account correctly when ordering tab complete
parent
ce833c9bba
commit
58d46825ce
|
@ -127,15 +127,9 @@ MemberEntry.fromMemberList = function(members) {
|
||||||
return 0; // don't care
|
return 0; // don't care
|
||||||
}
|
}
|
||||||
else { // both User objects exist
|
else { // both User objects exist
|
||||||
if (userA.lastActiveAgo < userB.lastActiveAgo) {
|
var lastActiveAgoA = userA.lastActiveAgo || Number.MAX_SAFE_INTEGER;
|
||||||
return -1; // a comes first
|
var lastActiveAgoB = userB.lastActiveAgo || Number.MAX_SAFE_INTEGER;
|
||||||
}
|
return lastActiveAgoA - lastActiveAgoB;
|
||||||
else if (userA.lastActiveAgo > userB.lastActiveAgo) {
|
|
||||||
return 1; // b comes first
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 0; // same last active ago
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}).map(function(m) {
|
}).map(function(m) {
|
||||||
return new MemberEntry(m);
|
return new MemberEntry(m);
|
||||||
|
|
Loading…
Reference in New Issue