mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
No need for Offline state if we're always in Waiting really
This commit is contained in:
parent
d70a57a7c9
commit
f90b435362
@ -4,7 +4,6 @@ import {ConnectionError} from "../error.js"
|
||||
import {ObservableValue} from "../../observable/ObservableValue.js";
|
||||
|
||||
export const ConnectionStatus = createEnum(
|
||||
"Offline",
|
||||
"Waiting",
|
||||
"Reconnecting",
|
||||
"Online"
|
||||
@ -37,9 +36,7 @@ export class Reconnector {
|
||||
}
|
||||
|
||||
async onRequestFailed(hsApi) {
|
||||
if (!this._isReconnecting) {
|
||||
this._setState(ConnectionStatus.Offline);
|
||||
|
||||
if (!this._isReconnecting) {
|
||||
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
||||
if (online) {
|
||||
this.tryNow();
|
||||
@ -149,7 +146,6 @@ export function tests() {
|
||||
clock.elapse(2000);
|
||||
await connectionStatus.waitFor(s => s === ConnectionStatus.Online).promise;
|
||||
assert.deepEqual(statuses, [
|
||||
ConnectionStatus.Offline,
|
||||
ConnectionStatus.Reconnecting,
|
||||
ConnectionStatus.Waiting,
|
||||
ConnectionStatus.Reconnecting,
|
||||
|
Loading…
Reference in New Issue
Block a user