Merge pull request #360 from matrix-org/dbkr/fix_tabcomplete_order_again

Fix tab complete order properly
This commit is contained in:
Richard van der Hoff 2016-07-21 16:35:27 +01:00 committed by GitHub
commit 9565eef84d

View file

@ -341,7 +341,12 @@ class TabComplete {
} }
if (a.kind == 'member') { 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 // anything else we have no ordering for