From 0a1ddeb11e89c41187523bd34b5a3ff151f67678 Mon Sep 17 00:00:00 2001 From: maciejhirsz Date: Fri, 13 Jul 2018 23:38:54 +0200 Subject: [PATCH] Mark connection as online on open socket --- packages/frontend/src/Connection.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/Connection.ts b/packages/frontend/src/Connection.ts index 690f2e2..4a22f7c 100644 --- a/packages/frontend/src/Connection.ts +++ b/packages/frontend/src/Connection.ts @@ -36,6 +36,8 @@ export class Connection { } function onSuccess() { + this.state = this.update({ status: 'online' }); + clean(); resolve(socket); } @@ -68,10 +70,7 @@ export class Connection { } private bindSocket() { - this.state = this.update({ - status: 'online', - nodes: new Map() - }); + this.state = this.update({ nodes: new Map() }); this.socket.addEventListener('message', this.handleMessages); this.socket.addEventListener('close', this.handleDisconnect); this.socket.addEventListener('error', this.handleDisconnect);