mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
SettingsFlag always run ToggleSwitch fully-controlled
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
84e71297ef
commit
2b9c102f07
1 changed files with 1 additions and 8 deletions
|
@ -62,13 +62,6 @@ module.exports = createReactClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const value = this.props.manualSave ? this.state.value : SettingsStore.getValueAt(
|
|
||||||
this.props.level,
|
|
||||||
this.props.name,
|
|
||||||
this.props.roomId,
|
|
||||||
this.props.isExplicit,
|
|
||||||
);
|
|
||||||
|
|
||||||
const canChange = SettingsStore.canSetValue(this.props.name, this.props.roomId, this.props.level);
|
const canChange = SettingsStore.canSetValue(this.props.name, this.props.roomId, this.props.level);
|
||||||
|
|
||||||
let label = this.props.label;
|
let label = this.props.label;
|
||||||
|
@ -78,7 +71,7 @@ module.exports = createReactClass({
|
||||||
return (
|
return (
|
||||||
<div className="mx_SettingsFlag">
|
<div className="mx_SettingsFlag">
|
||||||
<span className="mx_SettingsFlag_label">{label}</span>
|
<span className="mx_SettingsFlag_label">{label}</span>
|
||||||
<ToggleSwitch checked={value} onChange={this.onChange} disabled={!canChange} aria-label={label} />
|
<ToggleSwitch checked={this.state.value} onChange={this.onChange} disabled={!canChange} aria-label={label} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue