forked from mystiq/hydrogen-web
fix only reconnecting the first time
This commit is contained in:
parent
f8f13f54be
commit
2010704f14
1 changed files with 4 additions and 2 deletions
|
@ -35,6 +35,8 @@ export class Reconnector {
|
|||
|
||||
async onRequestFailed(hsApi) {
|
||||
if (!this._isReconnecting) {
|
||||
this._isReconnecting = true;
|
||||
|
||||
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
||||
if (online) {
|
||||
this.tryNow();
|
||||
|
@ -52,6 +54,7 @@ export class Reconnector {
|
|||
// unsubscribe from this._onlineStatus
|
||||
onlineStatusSubscription();
|
||||
}
|
||||
this._isReconnecting = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +78,6 @@ export class Reconnector {
|
|||
}
|
||||
|
||||
async _reconnectLoop(hsApi) {
|
||||
this._isReconnecting = true;
|
||||
this._versionsResponse = null;
|
||||
this._retryDelay.reset();
|
||||
|
||||
|
|
Loading…
Reference in a new issue