mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 20:36:57 +03:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
c68eb57798
1 changed files with 18 additions and 24 deletions
|
@ -160,32 +160,26 @@ 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 (listOrders[listKey]) {
|
||||||
switch (order) {
|
case "recent":
|
||||||
case "recent":
|
comparator = this._recentsComparator;
|
||||||
comparator = this._recentsComparator;
|
break;
|
||||||
break;
|
case "manual":
|
||||||
case "manual":
|
default:
|
||||||
default:
|
comparator = this._getManualComparator(listKey, optimisticRequest);
|
||||||
comparator = this._getManualComparator(listKey, optimisticRequest);
|
break;
|
||||||
break;
|
}
|
||||||
}
|
lists[listKey].sort(comparator);
|
||||||
lists[listKey].sort(comparator);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this._setState({
|
this._setState({
|
||||||
|
|
Loading…
Reference in a new issue