fix sort function for choosing primary user
This commit is contained in:
parent
8dd4b3f256
commit
7408e824cb
|
@ -494,7 +494,7 @@ Key.prototype.getPrimaryUser = async function(date=new Date()) {
|
||||||
primaryUsers = primaryUsers.sort(function(a, b) {
|
primaryUsers = primaryUsers.sort(function(a, b) {
|
||||||
const A = a.selfCertification;
|
const A = a.selfCertification;
|
||||||
const B = b.selfCertification;
|
const B = b.selfCertification;
|
||||||
return (B.isPrimaryUserID - A.isPrimaryUserID) || (B.created - A.created);
|
return (A.isPrimaryUserID - B.isPrimaryUserID) || (A.created - B.created);
|
||||||
});
|
});
|
||||||
return primaryUsers.pop();
|
return primaryUsers.pop();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user