Update comments in settings logic (#12148)

Follow-up on https://github.com/matrix-org/matrix-react-sdk/pull/12125
pull/28217/head
Richard van der Hoff 2024-01-16 17:12:01 +00:00 committed by GitHub
parent 79f2c9749b
commit dfebd59629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -127,9 +127,9 @@ export interface IBaseSetting<T extends SettingValueType = SettingValueType> {
/** /**
* If true, then the presence of this setting in `config.json` will disable the option in the UI. * If true, then the presence of this setting in `config.json` will disable the option in the UI.
* *
* In other words, we prevent the user overriding the setting if an explicit value is given in `config.json`; * In other words, we prevent the user overriding the setting if an explicit value is given in `config.json`.
* though note that users who have already set a non-default value before `config.json` is update will continue * XXX: note that users who have already set a non-default value before `config.json` is update will continue
* to use that value (and, indeed, won't be able to change it!) * to use that value (and, indeed, won't be able to change it!): https://github.com/element-hq/element-web/issues/26877
* *
* Obviously, this only really makes sense if `supportedLevels` includes {@link SettingLevel.CONFIG}. * Obviously, this only really makes sense if `supportedLevels` includes {@link SettingLevel.CONFIG}.
*/ */

View File

@ -528,7 +528,8 @@ export default class SettingsStore {
return false; return false;
} }
// When non-beta features are specified in the config.json, we force them as enabled or disabled. // For some config settings (mostly: non-beta features), a value in config.json overrides the local setting
// (ie: we force them as enabled or disabled).
if (SETTINGS[settingName]?.configDisablesSetting) { if (SETTINGS[settingName]?.configDisablesSetting) {
const configVal = SettingsStore.getValueAt(SettingLevel.CONFIG, settingName, roomId, true, true); const configVal = SettingsStore.getValueAt(SettingLevel.CONFIG, settingName, roomId, true, true);
if (configVal === true || configVal === false) return false; if (configVal === true || configVal === false) return false;