From 3ec75fdd3c614dd96929980fe9c6273c3f4cf1c3 Mon Sep 17 00:00:00 2001 From: Germain Date: Mon, 19 Dec 2022 11:57:57 +0000 Subject: [PATCH] Remove RoomList sorting settings (#9781) --- src/i18n/strings/en_EN.json | 2 -- src/settings/Settings.tsx | 12 ------------ src/stores/room-list/RoomListStore.ts | 7 ------- 3 files changed, 21 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7aacb9f976..b43e7e2891 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1007,8 +1007,6 @@ "Enable URL previews by default for participants in this room": "Enable URL previews by default for participants in this room", "Enable widget screenshots on supported widgets": "Enable widget screenshots on supported widgets", "Prompt before sending invites to potentially invalid matrix IDs": "Prompt before sending invites to potentially invalid matrix IDs", - "Order rooms by name": "Order rooms by name", - "Show rooms with unread notifications first": "Show rooms with unread notifications first", "Show shortcuts to recently viewed rooms above the room list": "Show shortcuts to recently viewed rooms above the room list", "Show shortcut to welcome checklist above the room list": "Show shortcut to welcome checklist above the room list", "Show hidden events in timeline": "Show hidden events in timeline", diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 00e62f733c..ae0cd5b30f 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -885,18 +885,6 @@ export const SETTINGS: { [setting: string]: ISetting } = { deny: [], }, }, - // TODO: Remove setting: https://github.com/vector-im/element-web/issues/14373 - "RoomList.orderAlphabetically": { - supportedLevels: LEVELS_ACCOUNT_SETTINGS, - displayName: _td("Order rooms by name"), - default: false, - }, - // TODO: Remove setting: https://github.com/vector-im/element-web/issues/14373 - "RoomList.orderByImportance": { - supportedLevels: LEVELS_ACCOUNT_SETTINGS, - displayName: _td("Show rooms with unread notifications first"), - default: true, - }, "breadcrumbs": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td("Show shortcuts to recently viewed rooms above the room list"), diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index 470c2b685f..78bbfb2e10 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -16,7 +16,6 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { Room } from "matrix-js-sdk/src/models/room"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; import { EventType } from "matrix-js-sdk/src/@types/event"; @@ -387,7 +386,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements // logic must match calculateListOrder private calculateTagSorting(tagId: TagID): SortAlgorithm { - const settingAlphabetical = SettingsStore.getValue("RoomList.orderAlphabetically", null, true); const definedSort = this.getTagSorting(tagId); const storedSort = this.getStoredTagSorting(tagId); @@ -397,8 +395,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements let tagSort = SortAlgorithm.Recent; if (storedSort) { tagSort = storedSort; - } else if (!isNullOrUndefined(settingAlphabetical)) { - tagSort = settingAlphabetical ? SortAlgorithm.Alphabetic : SortAlgorithm.Recent; } else if (definedSort) { tagSort = definedSort; } // else default (already set) @@ -430,7 +426,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements // logic must match calculateTagSorting private calculateListOrder(tagId: TagID): ListAlgorithm { const defaultOrder = ListAlgorithm.Importance; - const settingImportance = SettingsStore.getValue("RoomList.orderByImportance", null, true); const definedOrder = this.getListOrder(tagId); const storedOrder = this.getStoredListOrder(tagId); @@ -440,8 +435,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements let listOrder = defaultOrder; if (storedOrder) { listOrder = storedOrder; - } else if (!isNullOrUndefined(settingImportance)) { - listOrder = settingImportance ? ListAlgorithm.Importance : ListAlgorithm.Natural; } else if (definedOrder) { listOrder = definedOrder; } // else default (already set)