Do not disconnect WebSocket when NetworkIndicator on componentWillUnmount (#2368)

* Do not disconnect websocket when networkIndicator unmounts

* feedback review
This commit is contained in:
Elias Nahum 2018-11-22 20:23:25 -03:00 committed by GitHub
parent 736a955be8
commit aa9fef955f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,16 +112,11 @@ export default class NetworkIndicator extends PureComponent {
componentWillUnmount() {
this.mounted = false;
const {closeWebSocket, stopPeriodicStatusUpdates} = this.props.actions;
this.networkListener.removeEventListener();
AppState.removeEventListener('change', this.handleAppStateChange);
closeWebSocket();
stopPeriodicStatusUpdates();
clearTimeout(this.connectionRetryTimeout);
this.connectionRetryTimeout = null;
}
connect = (displayBar = false) => {