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

Commit

Permalink
Update comments in settings logic (#12148)
Browse files Browse the repository at this point in the history
Follow-up on #12125
  • Loading branch information
richvdh authored Jan 16, 2024
1 parent 79f2c97 commit dfebd59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* 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
* to use that value (and, indeed, won't be able to change it!)
* In other words, we prevent the user overriding the setting if an explicit value is given in `config.json`.
* 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!): https://github.com/element-hq/element-web/issues/26877
*
* Obviously, this only really makes sense if `supportedLevels` includes {@link SettingLevel.CONFIG}.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/settings/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ export default class SettingsStore {
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) {
const configVal = SettingsStore.getValueAt(SettingLevel.CONFIG, settingName, roomId, true, true);
if (configVal === true || configVal === false) return false;
Expand Down

0 comments on commit dfebd59

Please sign in to comment.