mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Always render disabled settings as disabled (#7014)
This is to prevent user confusion about whether or not a setting exists, or even what its value is. By rendering it with `disabled=true` the user is at least aware that the setting is set to a specific value, though we could (and should) do better in the future to communicate *why* a setting is disabled.
This commit is contained in:
parent
a1a19c7433
commit
39e98b9d7f
@ -288,14 +288,10 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
||||
private renderGroup(
|
||||
settingIds: string[],
|
||||
level = SettingLevel.ACCOUNT,
|
||||
includeDisabled = false,
|
||||
): React.ReactNodeArray {
|
||||
if (!includeDisabled) {
|
||||
settingIds = settingIds.filter(SettingsStore.isEnabled);
|
||||
}
|
||||
|
||||
return settingIds.map(i => {
|
||||
return <SettingsFlag key={i} name={i} level={level} />;
|
||||
const disabled = !SettingsStore.isEnabled(i);
|
||||
return <SettingsFlag key={i} name={i} level={level} disabled={disabled} />;
|
||||
});
|
||||
}
|
||||
|
||||
@ -343,7 +339,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
||||
|
||||
<div className="mx_SettingsTab_section">
|
||||
<span className="mx_SettingsTab_subheading">{ _t("Spaces") }</span>
|
||||
{ this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT, true) }
|
||||
{ this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT) }
|
||||
</div>
|
||||
|
||||
<div className="mx_SettingsTab_section">
|
||||
|
Loading…
Reference in New Issue
Block a user