Doing UserJoin on connect / reconnect.
This commit is contained in:
parent
3ddbe2e370
commit
ad8e47f8d2
1 changed files with 3 additions and 4 deletions
7
ui/src/services/WebSocketService.ts
vendored
7
ui/src/services/WebSocketService.ts
vendored
|
@ -61,6 +61,9 @@ export class WebSocketService {
|
||||||
this.ws = new ReconnectingWebSocket(wsUri);
|
this.ws = new ReconnectingWebSocket(wsUri);
|
||||||
this.ws.onopen = () => {
|
this.ws.onopen = () => {
|
||||||
console.log(`Connected to ${wsUri}`);
|
console.log(`Connected to ${wsUri}`);
|
||||||
|
if (UserService.Instance.user) {
|
||||||
|
this.userJoin();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.subject = Observable.create((obs: any) => {
|
this.subject = Observable.create((obs: any) => {
|
||||||
|
@ -68,10 +71,6 @@ export class WebSocketService {
|
||||||
obs.next(JSON.parse(e.data));
|
obs.next(JSON.parse(e.data));
|
||||||
};
|
};
|
||||||
}).pipe(share());
|
}).pipe(share());
|
||||||
|
|
||||||
if (UserService.Instance.user) {
|
|
||||||
this.userJoin();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static get Instance() {
|
public static get Instance() {
|
||||||
|
|
Loading…
Reference in a new issue