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

Always render disabled settings as disabled #7014

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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