Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Always render disabled settings as disabled (#7014)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
turt2live authored Oct 22, 2021
1 parent a1a19c7 commit 39e98b9
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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} />;
});
}

Expand Down Expand Up @@ -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">
Expand Down

0 comments on commit 39e98b9

Please sign in to comment.