mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
fix only reconnecting the first time
This commit is contained in:
parent
f8f13f54be
commit
2010704f14
@ -34,7 +34,9 @@ export class Reconnector {
|
||||
}
|
||||
|
||||
async onRequestFailed(hsApi) {
|
||||
if (!this._isReconnecting) {
|
||||
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 New Issue
Block a user