From aa9fef955fee0d7f0e2a11e4cbee46ea2462191e Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 22 Nov 2018 20:23:25 -0300 Subject: [PATCH] Do not disconnect WebSocket when NetworkIndicator on componentWillUnmount (#2368) * Do not disconnect websocket when networkIndicator unmounts * feedback review --- app/components/network_indicator/network_indicator.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/components/network_indicator/network_indicator.js b/app/components/network_indicator/network_indicator.js index 3d8faf170..bef1d5bdc 100644 --- a/app/components/network_indicator/network_indicator.js +++ b/app/components/network_indicator/network_indicator.js @@ -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) => {