diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-07-24 15:52:20 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-07-27 09:11:38 +0100 |
| commit | c206f43bbcbd08c210e850a92a09c7fc5fea9394 (patch) | |
| tree | 9e7482891a7eb6b39ec0e8272ad713a28f6d7149 /app/components | |
| parent | 1243076c3c8c824a99a230d008ee456ee1ed0b30 (diff) | |
| download | mullvadvpn-c206f43bbcbd08c210e850a92a09c7fc5fea9394.tar.xz mullvadvpn-c206f43bbcbd08c210e850a92a09c7fc5fea9394.zip | |
Remove JSDOM and update Switch component
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Switch.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/components/Switch.js b/app/components/Switch.js index 4f97c4d992..f0ad3b41bc 100644 --- a/app/components/Switch.js +++ b/app/components/Switch.js @@ -119,6 +119,13 @@ export default class Switch extends Component { this.isCapturingMouseEvents = false; } + componentWillUnmount() { + // guard from abrupt programmatic unmount + if(this.isCapturingMouseEvents) { + this.stopCapturingMouseEvents(); + } + } + render(): React.Element<*> { const { isOn, onChange, ...otherProps } = this.props; // eslint-disable-line no-unused-vars let className = ('switch' + ' ' + (otherProps.className || '')).trim(); |
