diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index fc73e375fa..3d8c50b7cb 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -196,6 +196,10 @@ const RocketChat = { clearTimeout(this.connectTimeout); } + if (this.connectingListener) { + this.connectingListener.then(this.stopListener); + } + if (this.connectedListener) { this.connectedListener.then(this.stopListener); } @@ -243,7 +247,7 @@ const RocketChat = { sdkConnect(); - this.connectedListener = this.sdk.onStreamData('connecting', () => { + this.connectingListener = this.sdk.onStreamData('connecting', () => { reduxStore.dispatch(connectRequest()); });