mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Add a UI Feature flag for room history settings
This commit is contained in:
parent
0adb920448
commit
a501d698aa
@ -25,6 +25,7 @@ import QuestionDialog from "../../../dialogs/QuestionDialog";
|
||||
import StyledRadioGroup from '../../../elements/StyledRadioGroup';
|
||||
import {SettingLevel} from "../../../../../settings/SettingLevel";
|
||||
import SettingsStore from "../../../../../settings/SettingsStore";
|
||||
import {UIFeature} from "../../../../../settings/UIFeature";
|
||||
|
||||
export default class SecurityRoomSettingsTab extends React.Component {
|
||||
static propTypes = {
|
||||
@ -350,6 +351,16 @@ export default class SecurityRoomSettingsTab extends React.Component {
|
||||
/>;
|
||||
}
|
||||
|
||||
let historySection = (<>
|
||||
<span className='mx_SettingsTab_subheading'>{_t("Who can read history?")}</span>
|
||||
<div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'>
|
||||
{this._renderHistory()}
|
||||
</div>
|
||||
</>);
|
||||
if (!SettingsStore.getValue(UIFeature.RoomHistorySettings)) {
|
||||
historySection = null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx_SettingsTab mx_SecurityRoomSettingsTab">
|
||||
<div className="mx_SettingsTab_heading">{_t("Security & Privacy")}</div>
|
||||
@ -371,10 +382,7 @@ export default class SecurityRoomSettingsTab extends React.Component {
|
||||
{this._renderRoomAccess()}
|
||||
</div>
|
||||
|
||||
<span className='mx_SettingsTab_subheading'>{_t("Who can read history?")}</span>
|
||||
<div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'>
|
||||
{this._renderHistory()}
|
||||
</div>
|
||||
{historySection}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -630,6 +630,10 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||
default: null,
|
||||
},
|
||||
[UIFeature.RoomHistorySettings]: {
|
||||
supportedLevels: LEVELS_UI_FEATURE,
|
||||
default: true,
|
||||
},
|
||||
[UIFeature.AdvancedEncryption]: {
|
||||
supportedLevels: LEVELS_UI_FEATURE,
|
||||
default: true,
|
||||
|
@ -31,4 +31,5 @@ export enum UIFeature {
|
||||
Flair = "UIFeature.flair",
|
||||
Communities = "UIFeature.communities",
|
||||
AdvancedSettings = "UIFeature.advancedSettings",
|
||||
RoomHistorySettings = "UIFeature.roomHistorySettings",
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user