From: Dessalines Date: Sun, 2 Feb 2020 21:37:57 +0000 (-0500) Subject: Doing UserJoin on connect / reconnect. X-Git-Url: http://these/git/%7B%60https:/static/%24%7Bargs.thread.url%7D?a=commitdiff_plain;h=cd57e612c199bd12b1dcba0704e80a042cdbfc80;p=lemmy.git Doing UserJoin on connect / reconnect. --- diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index 0b4def1c..c5e45e79 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() {