Change room list sorting to activity and unread first by default (#9773)

This commit is contained in:
Germain
2022-12-19 10:42:58 +00:00
committed by GitHub
parent 35a187a231
commit 8541e1c4b5
2 changed files with 37 additions and 4 deletions

View File

@@ -387,8 +387,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> implements
// logic must match calculateListOrder
private calculateTagSorting(tagId: TagID): SortAlgorithm {
const isDefaultRecent = tagId === DefaultTagID.Invite || tagId === DefaultTagID.DM;
const defaultSort = isDefaultRecent ? SortAlgorithm.Recent : SortAlgorithm.Alphabetic;
const settingAlphabetical = SettingsStore.getValue("RoomList.orderAlphabetically", null, true);
const definedSort = this.getTagSorting(tagId);
const storedSort = this.getStoredTagSorting(tagId);
@@ -396,7 +394,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> implements
// We use the following order to determine which of the 4 flags to use:
// Stored > Settings > Defined > Default
let tagSort = defaultSort;
let tagSort = SortAlgorithm.Recent;
if (storedSort) {
tagSort = storedSort;
} else if (!isNullOrUndefined(settingAlphabetical)) {
@@ -431,7 +429,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> implements
// logic must match calculateTagSorting
private calculateListOrder(tagId: TagID): ListAlgorithm {
const defaultOrder = ListAlgorithm.Natural;
const defaultOrder = ListAlgorithm.Importance;
const settingImportance = SettingsStore.getValue("RoomList.orderByImportance", null, true);
const definedOrder = this.getListOrder(tagId);
const storedOrder = this.getStoredListOrder(tagId);