]> Untitled Git - lemmy.git/commitdiff
Doing UserJoin on connect / reconnect.
authorDessalines <tyhou13@gmx.com>
Sun, 2 Feb 2020 21:37:57 +0000 (16:37 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 2 Feb 2020 21:37:57 +0000 (16:37 -0500)
ui/src/services/WebSocketService.ts

index 0b4def1c0946f7c42d032fa6a0906b8b8d336a08..c5e45e791aef8a3f0755384c5ac19d3e75fe8e30 100644 (file)
@@ -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() {