mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 09:46:09 +03:00
Disable use of account-level ordering options in new room list
Fixes https://github.com/vector-im/riot-web/issues/14069 We can't drop them completely for compatibility with the old room list.
This commit is contained in:
parent
2eaaf6a7bd
commit
d402808101
3 changed files with 19 additions and 8 deletions
|
@ -23,6 +23,7 @@ import SettingsStore from "../../../../../settings/SettingsStore";
|
||||||
import Field from "../../../elements/Field";
|
import Field from "../../../elements/Field";
|
||||||
import * as sdk from "../../../../..";
|
import * as sdk from "../../../../..";
|
||||||
import PlatformPeg from "../../../../../PlatformPeg";
|
import PlatformPeg from "../../../../../PlatformPeg";
|
||||||
|
import {RoomListStoreTempProxy} from "../../../../../stores/room-list/RoomListStoreTempProxy";
|
||||||
|
|
||||||
export default class PreferencesUserSettingsTab extends React.Component {
|
export default class PreferencesUserSettingsTab extends React.Component {
|
||||||
static ROOM_LIST_SETTINGS = [
|
static ROOM_LIST_SETTINGS = [
|
||||||
|
@ -31,6 +32,19 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
||||||
'breadcrumbs',
|
'breadcrumbs',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// TODO: Remove temp structures: https://github.com/vector-im/riot-web/issues/14231
|
||||||
|
static ROOM_LIST_2_SETTINGS = [
|
||||||
|
'breadcrumbs',
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO: Remove temp structures: https://github.com/vector-im/riot-web/issues/14231
|
||||||
|
static ELIGIBLE_ROOM_LIST_SETTINGS = () => {
|
||||||
|
if (RoomListStoreTempProxy.isUsingNewStore()) {
|
||||||
|
return PreferencesUserSettingsTab.ROOM_LIST_2_SETTINGS;
|
||||||
|
}
|
||||||
|
return PreferencesUserSettingsTab.ROOM_LIST_SETTINGS;
|
||||||
|
};
|
||||||
|
|
||||||
static COMPOSER_SETTINGS = [
|
static COMPOSER_SETTINGS = [
|
||||||
'MessageComposerInput.autoReplaceEmoji',
|
'MessageComposerInput.autoReplaceEmoji',
|
||||||
'MessageComposerInput.suggestEmoji',
|
'MessageComposerInput.suggestEmoji',
|
||||||
|
@ -175,7 +189,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
<div className="mx_SettingsTab_section">
|
<div className="mx_SettingsTab_section">
|
||||||
<span className="mx_SettingsTab_subheading">{_t("Room list")}</span>
|
<span className="mx_SettingsTab_subheading">{_t("Room list")}</span>
|
||||||
{this._renderGroup(PreferencesUserSettingsTab.ROOM_LIST_SETTINGS)}
|
{this._renderGroup(PreferencesUserSettingsTab.ELIGIBLE_ROOM_LIST_SETTINGS())}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx_SettingsTab_section">
|
<div className="mx_SettingsTab_section">
|
||||||
|
|
|
@ -478,11 +478,13 @@ export const SETTINGS = {
|
||||||
deny: [],
|
deny: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// TODO: Remove setting: https://github.com/vector-im/riot-web/issues/14231
|
||||||
"RoomList.orderAlphabetically": {
|
"RoomList.orderAlphabetically": {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
displayName: _td("Order rooms by name"),
|
displayName: _td("Order rooms by name"),
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
// TODO: Remove setting: https://github.com/vector-im/riot-web/issues/14231
|
||||||
"RoomList.orderByImportance": {
|
"RoomList.orderByImportance": {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
displayName: _td("Show rooms with unread notifications first"),
|
displayName: _td("Show rooms with unread notifications first"),
|
||||||
|
|
|
@ -50,8 +50,6 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
|
||||||
private tagWatcher = new TagWatcher(this);
|
private tagWatcher = new TagWatcher(this);
|
||||||
|
|
||||||
private readonly watchedSettings = [
|
private readonly watchedSettings = [
|
||||||
'RoomList.orderAlphabetically',
|
|
||||||
'RoomList.orderByImportance',
|
|
||||||
'feature_custom_tags',
|
'feature_custom_tags',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -338,11 +336,8 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateAlgorithmInstances() {
|
private async updateAlgorithmInstances() {
|
||||||
const orderByImportance = SettingsStore.getValue("RoomList.orderByImportance");
|
const defaultSort = SortAlgorithm.Alphabetic;
|
||||||
const orderAlphabetically = SettingsStore.getValue("RoomList.orderAlphabetically");
|
const defaultOrder = ListAlgorithm.Natural;
|
||||||
|
|
||||||
const defaultSort = orderAlphabetically ? SortAlgorithm.Alphabetic : SortAlgorithm.Recent;
|
|
||||||
const defaultOrder = orderByImportance ? ListAlgorithm.Importance : ListAlgorithm.Natural;
|
|
||||||
|
|
||||||
for (const tag of Object.keys(this.orderedLists)) {
|
for (const tag of Object.keys(this.orderedLists)) {
|
||||||
const definedSort = this.getTagSorting(tag);
|
const definedSort = this.getTagSorting(tag);
|
||||||
|
|
Loading…
Reference in a new issue