[FIX] Sometimes SDK is null when try to connect (#2131)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
6152da4d6c
commit
a4914d73cb
|
@ -225,13 +225,12 @@ const RocketChat = {
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log('connect error', err);
|
console.log('connect error', err);
|
||||||
|
|
||||||
const { server: currentServer } = reduxStore.getState().server;
|
|
||||||
if (server === currentServer) {
|
|
||||||
// when `connect` raises an error, we try again in 10 seconds
|
// when `connect` raises an error, we try again in 10 seconds
|
||||||
this.connectTimeout = setTimeout(() => {
|
this.connectTimeout = setTimeout(() => {
|
||||||
|
if (this.sdk?.client?.host === server) {
|
||||||
sdkConnect();
|
sdkConnect();
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
|
}, 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
sdkConnect();
|
sdkConnect();
|
||||||
|
|
Loading…
Reference in New Issue