mirror of https://github.com/vector-im/riot-web
Merge pull request #2590 from matrix-org/travis/settings/fix-directory-publish
Ensure toggle switches listen to property changespull/21833/head
commit
78ea531a87
|
@ -38,6 +38,12 @@ export default class ToggleSwitch extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.checked !== this.state.checked) {
|
||||
this.setState({checked: nextProps.checked});
|
||||
}
|
||||
}
|
||||
|
||||
_onClick = (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue