Merge pull request #1750 from matrix-org/luke/fix-room-list-custom-tag-ordering2

Fix custom tags not being ordered manually
This commit is contained in:
David Baker 2018-02-14 11:40:59 +00:00 committed by GitHub
commit ca763faf96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,22 +160,17 @@ class RoomListStore extends Store {
}); });
const listOrders = { const listOrders = {
"manual": [ "m.favourite": "manual",
"m.favourite", "im.vector.fake.invite": "recent",
], "im.vector.fake.recent": "recent",
"recent": [ "im.vector.fake.direct": "recent",
"im.vector.fake.invite", "m.lowpriority": "recent",
"im.vector.fake.recent", "im.vector.fake.archived": "recent",
"im.vector.fake.direct",
"m.lowpriority",
"im.vector.fake.archived",
],
}; };
Object.keys(listOrders).forEach((order) => { Object.keys(lists).forEach((listKey) => {
listOrders[order].forEach((listKey) => {
let comparator; let comparator;
switch (order) { switch (listOrders[listKey]) {
case "recent": case "recent":
comparator = this._recentsComparator; comparator = this._recentsComparator;
break; break;
@ -186,7 +181,6 @@ class RoomListStore extends Store {
} }
lists[listKey].sort(comparator); lists[listKey].sort(comparator);
}); });
});
this._setState({ this._setState({
lists, lists,