You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Fix config override of other settings levels (#12593)
* Make config override other settings levels and add tests * fix documentation * lint * Use a const for finalLevel. * respect the explicit parameter * Use supportedLevelsAreOrdered for config overrides rather than a separate setting. * Fix typos * Fix mock in UserSetttingsDialog-test * Special case disabling of setting tos use config overrides. * remove logs
This commit is contained in:
@@ -62,6 +62,13 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private getSettingValue(): boolean {
|
||||
// If a level defined in props is overridden by a level at a high presedence, it gets disabled
|
||||
// and we should show the overridding value.
|
||||
if (
|
||||
SettingsStore.settingIsOveriddenAtConfigLevel(this.props.name, this.props.roomId ?? null, this.props.level)
|
||||
) {
|
||||
return !!SettingsStore.getValue(this.props.name);
|
||||
}
|
||||
return !!SettingsStore.getValueAt(
|
||||
this.props.level,
|
||||
this.props.name,
|
||||
|
Reference in New Issue
Block a user