Introduce a concept of UI features, using it for URL previews at first
Fixes https://github.com/vector-im/element-web/issues/15176 This is effectively the base for all of https://github.com/vector-im/element-web/issues/15185
This commit is contained in:
parent
ab91ce4b2d
commit
f4f30a3274
7 changed files with 108 additions and 6 deletions
|
@ -23,6 +23,7 @@ import Field from "../../../elements/Field";
|
|||
import * as sdk from "../../../../..";
|
||||
import PlatformPeg from "../../../../../PlatformPeg";
|
||||
import {SettingLevel} from "../../../../../settings/SettingLevel";
|
||||
import {UIFeature} from "../../../../../settings/UIFeature";
|
||||
|
||||
export default class PreferencesUserSettingsTab extends React.Component {
|
||||
static ROOM_LIST_SETTINGS = [
|
||||
|
@ -138,6 +139,10 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
|||
};
|
||||
|
||||
_renderGroup(settingIds) {
|
||||
if (!SettingsStore.getValue(UIFeature.URLPreviews)) {
|
||||
settingIds = settingIds.filter(i => i !== 'urlPreviewsEnabled');
|
||||
}
|
||||
|
||||
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
|
||||
return settingIds.map(i => <SettingsFlag key={i} name={i} level={SettingLevel.ACCOUNT} />);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue