You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Consolidate disabling of history options
Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
@@ -350,17 +350,14 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||||||
const options = [
|
const options = [
|
||||||
{
|
{
|
||||||
value: HistoryVisibility.Shared,
|
value: HistoryVisibility.Shared,
|
||||||
disabled: !canChangeHistory,
|
|
||||||
label: _t('Members only (since the point in time of selecting this option)'),
|
label: _t('Members only (since the point in time of selecting this option)'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: HistoryVisibility.Invited,
|
value: HistoryVisibility.Invited,
|
||||||
disabled: !canChangeHistory,
|
|
||||||
label: _t('Members only (since they were invited)'),
|
label: _t('Members only (since they were invited)'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: HistoryVisibility.Joined,
|
value: HistoryVisibility.Joined,
|
||||||
disabled: !canChangeHistory,
|
|
||||||
label: _t('Members only (since they joined)'),
|
label: _t('Members only (since they joined)'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -369,7 +366,6 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||||||
if (!this.state.encrypted || history === HistoryVisibility.WorldReadable) {
|
if (!this.state.encrypted || history === HistoryVisibility.WorldReadable) {
|
||||||
options.unshift({
|
options.unshift({
|
||||||
value: HistoryVisibility.WorldReadable,
|
value: HistoryVisibility.WorldReadable,
|
||||||
disabled: !canChangeHistory,
|
|
||||||
label: _t("Anyone"),
|
label: _t("Anyone"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -384,6 +380,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||||||
name="historyVis"
|
name="historyVis"
|
||||||
value={history}
|
value={history}
|
||||||
onChange={this.onHistoryRadioToggle}
|
onChange={this.onHistoryRadioToggle}
|
||||||
|
disabled={!canChangeHistory}
|
||||||
definitions={options}
|
definitions={options}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user