mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fix only reconnecting the first time
This commit is contained in:
parent
f8f13f54be
commit
2010704f14
@ -35,6 +35,8 @@ export class Reconnector {
|
|||||||
|
|
||||||
async onRequestFailed(hsApi) {
|
async onRequestFailed(hsApi) {
|
||||||
if (!this._isReconnecting) {
|
if (!this._isReconnecting) {
|
||||||
|
this._isReconnecting = true;
|
||||||
|
|
||||||
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
||||||
if (online) {
|
if (online) {
|
||||||
this.tryNow();
|
this.tryNow();
|
||||||
@ -52,6 +54,7 @@ export class Reconnector {
|
|||||||
// unsubscribe from this._onlineStatus
|
// unsubscribe from this._onlineStatus
|
||||||
onlineStatusSubscription();
|
onlineStatusSubscription();
|
||||||
}
|
}
|
||||||
|
this._isReconnecting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +78,6 @@ export class Reconnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _reconnectLoop(hsApi) {
|
async _reconnectLoop(hsApi) {
|
||||||
this._isReconnecting = true;
|
|
||||||
this._versionsResponse = null;
|
this._versionsResponse = null;
|
||||||
this._retryDelay.reset();
|
this._retryDelay.reset();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user