From 39e98b9d7f41756f7ff170925c5b81c1d919cab2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 22 Oct 2021 11:30:14 -0600 Subject: [PATCH] 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. --- .../settings/tabs/user/PreferencesUserSettingsTab.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 8363935107..7e0cf74d86 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -288,14 +288,10 @@ export default class PreferencesUserSettingsTab extends React.Component { - return ; + const disabled = !SettingsStore.isEnabled(i); + return ; }); } @@ -343,7 +339,7 @@ export default class PreferencesUserSettingsTab extends React.Component { _t("Spaces") } - { this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT, true) } + { this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT) }