[FIX] Connecting stream listener not being cleared (#3008)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Noach Magedman 2021-05-05 19:02:26 +03:00 committed by GitHub
parent 6798f039f3
commit fc52286bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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());
});