From a95c45eb9680517518edcaede18ef1d4b94712dd Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 18 Apr 2016 14:48:55 +0100 Subject: [PATCH] final(?) PR fixes --- src/components/views/rooms/MemberList.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index c490a72e46..8f392aac95 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -357,9 +357,9 @@ module.exports = React.createClass({ } }, - // returns -1 if a < b. - // 0 if a and b are equivalent - // 1 if a > b. + // returns negative if a comes before b, + // returns 0 if a and b are equivalent in ordering + // returns positive if a comes after b. memberSort: function(userIdA, userIdB) { // order by last active, with "active now" first. // ...and then by power @@ -419,12 +419,12 @@ module.exports = React.createClass({ } */ - var lastActiveTsA = userA && userA.lastActiveAgo ? (userA.lastPresenceTs - userA.lastActiveAgo) : Number.MAX_SAFE_INTEGER; - var lastActiveTsB = userB && userB.lastActiveAgo ? (userB.lastPresenceTs - userB.lastActiveAgo) : Number.MAX_SAFE_INTEGER; + var lastActiveTsA = userA && userA.lastActiveTs ? userA.lastActiveTs : 0; + var lastActiveTsB = userB && userB.lastActiveTs ? userB.lastActiveTs : 0; // console.log("comparing ts: " + lastActiveTsA + " and " + lastActiveTsB); - return lastActiveTsA - lastActiveTsB; + return lastActiveTsB - lastActiveTsA; } },