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

Commit

Permalink
Merge pull request #2590 from matrix-org/travis/settings/fix-director…
Browse files Browse the repository at this point in the history
…y-publish

Ensure toggle switches listen to property changes
  • Loading branch information
turt2live authored Feb 8, 2019
2 parents 47b79c0 + 89a8422 commit 78ea531
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/views/elements/ToggleSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 78ea531

Please sign in to comment.