mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +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";
|
import {ObservableValue} from "../../observable/ObservableValue.js";
|
||||||
|
|
||||||
export const ConnectionStatus = createEnum(
|
export const ConnectionStatus = createEnum(
|
||||||
"Offline",
|
|
||||||
"Waiting",
|
"Waiting",
|
||||||
"Reconnecting",
|
"Reconnecting",
|
||||||
"Online"
|
"Online"
|
||||||
@ -38,8 +37,6 @@ export class Reconnector {
|
|||||||
|
|
||||||
async onRequestFailed(hsApi) {
|
async onRequestFailed(hsApi) {
|
||||||
if (!this._isReconnecting) {
|
if (!this._isReconnecting) {
|
||||||
this._setState(ConnectionStatus.Offline);
|
|
||||||
|
|
||||||
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
const onlineStatusSubscription = this._onlineStatus && this._onlineStatus.subscribe(online => {
|
||||||
if (online) {
|
if (online) {
|
||||||
this.tryNow();
|
this.tryNow();
|
||||||
@ -149,7 +146,6 @@ export function tests() {
|
|||||||
clock.elapse(2000);
|
clock.elapse(2000);
|
||||||
await connectionStatus.waitFor(s => s === ConnectionStatus.Online).promise;
|
await connectionStatus.waitFor(s => s === ConnectionStatus.Online).promise;
|
||||||
assert.deepEqual(statuses, [
|
assert.deepEqual(statuses, [
|
||||||
ConnectionStatus.Offline,
|
|
||||||
ConnectionStatus.Reconnecting,
|
ConnectionStatus.Reconnecting,
|
||||||
ConnectionStatus.Waiting,
|
ConnectionStatus.Waiting,
|
||||||
ConnectionStatus.Reconnecting,
|
ConnectionStatus.Reconnecting,
|
||||||
|
Loading…
Reference in New Issue
Block a user