forked from mystiq/hydrogen-web
No need for Offline state if we're always in Waiting really
This commit is contained in:
parent
d70a57a7c9
commit
f90b435362
1 changed files with 1 additions and 5 deletions
|
@ -4,7 +4,6 @@ import {ConnectionError} from "../error.js"
|
|||
import {ObservableValue} from "../../observable/ObservableValue.js";
|
||||
|
||||
export const ConnectionStatus = createEnum(
|
||||
"Offline",
|
||||
"Waiting",
|
||||
"Reconnecting",
|
||||
"Online"
|
||||
|
@ -38,8 +37,6 @@ export class Reconnector {
|
|||
|
||||
async onRequestFailed(hsApi) {
|
||||
if (!this._isReconnecting) {
|
||||
this._setState(ConnectionStatus.Offline);
|
||||
|
||||
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 a new issue