diff options
author | Dessalines <tyhou13@gmx.com> | 2020-02-02 16:37:57 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-02-02 16:37:57 -0500 |
commit | cd57e612c199bd12b1dcba0704e80a042cdbfc80 (patch) | |
tree | 076936e3683a0a56993c51cb08eacb3806e5f1d3 /ui | |
parent | caba049da12017f22a8ffa8d6b8e7f0a2cc20e6a (diff) |
Doing UserJoin on connect / reconnect.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/src/services/WebSocketService.ts | 7 |
1 files changed, 3 insertions, 4 deletions
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() { |