From ad8e47f8d20d366115e3407930ed6ac19e84f579 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 2 Feb 2020 16:37:57 -0500 Subject: [PATCH] Doing UserJoin on connect / reconnect. --- ui/src/services/WebSocketService.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index 0b4def1..c5e45e7 100644 --- a/ui/src/services/WebSocketService.ts +++ b/ui/src/services/WebSocketService.ts @@ -61,6 +61,9 @@ export class WebSocketService { this.ws = new ReconnectingWebSocket(wsUri); this.ws.onopen = () => { console.log(`Connected to ${wsUri}`); + if (UserService.Instance.user) { + this.userJoin(); + } }; this.subject = Observable.create((obs: any) => { @@ -68,10 +71,6 @@ export class WebSocketService { obs.next(JSON.parse(e.data)); }; }).pipe(share()); - - if (UserService.Instance.user) { - this.userJoin(); - } } public static get Instance() {