Fix tab complete order properly

Don't return NaN from your sort functions...
This commit is contained in:
David Baker 2016-07-21 16:25:51 +01:00
parent 46a2c74d71
commit 0b0f10ddf6

View file

@ -341,7 +341,12 @@ class TabComplete {
}
if (a.kind == 'member') {
return this.memberTabOrder[b.member.userId] - this.memberTabOrder[a.member.userId];
let orderA = this.memberTabOrder[a.member.userId];
let orderB = this.memberTabOrder[b.member.userId];
if (orderA === undefined) orderA = -1;
if (orderB === undefined) orderB = -1;
return orderB - orderA;
}
// anything else we have no ordering for