diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js index 09b9151ddc..ba6695ecf1 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js @@ -48,7 +48,7 @@ export default class PreferencesUserSettingsTab extends React.Component { ]; static ROOM_LIST_SETTINGS = [ - 'RoomList.orderByRecents', + 'RoomList.orderAlphabetically', 'RoomList.orderByImportance', 'breadcrumbs', ]; diff --git a/src/settings/Settings.js b/src/settings/Settings.js index b35301f124..e384aa8f0f 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -433,10 +433,11 @@ export const SETTINGS = { deny: [], }, }, - "RoomList.orderByRecents": { + "RoomList.orderAlphabetically": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, - displayName: _td("Order rooms by message activity instead of by name"), + displayName: _td("Order rooms alphabetically by name instead of by recent activity"), default: true, + invertedSettingName: "RoomList.orderByRecents", }, "RoomList.orderByImportance": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index e0d60c3eac..30b523d35d 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -133,8 +133,8 @@ class RoomListStore extends Store { orderImportantFirst: false, }; + SettingsStore.monitorSetting('RoomList.orderAlphabetically', null); SettingsStore.monitorSetting('RoomList.orderByImportance', null); - SettingsStore.monitorSetting('RoomList.orderByRecents', null); SettingsStore.monitorSetting('feature_custom_tags', null); } @@ -161,8 +161,8 @@ class RoomListStore extends Store { if (!logicallyReady) break; switch (payload.settingName) { - case "RoomList.orderByRecents": - this.updateSortingAlgorithm(payload.newValue ? ALGO_RECENT : ALGO_ALPHABETIC, + case "RoomList.orderAlphabetically": + this.updateSortingAlgorithm(payload.newValue ? ALGO_ALPHABETIC : ALGO_RECENT, this._state.orderImportantFirst); break; case "RoomList.orderByImportance": @@ -189,9 +189,9 @@ class RoomListStore extends Store { this._matrixClient = payload.matrixClient; - const orderByRecents = SettingsStore.getValue("RoomList.orderByRecents"); const orderByImportance = SettingsStore.getValue("RoomList.orderByImportance"); - this.updateSortingAlgorithm(orderByRecents ? ALGO_RECENT : ALGO_ALPHABETIC, orderByImportance); + const orderAlphabetically = SettingsStore.getValue("RoomList.orderAlphabetically"); + this.updateSortingAlgorithm(orderAlphabetically ? ALGO_ALPHABETIC : ALGO_RECENT, orderByImportance); } break; case 'MatrixActions.Room.receipt': {