Bugfix: Websocket data push stopped working on disconnect, bug caused by 3dedf1e3

This commit is contained in:
softsimon 2020-09-29 20:52:32 +07:00
parent e8de73cfbc
commit 7c6c330b02
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -158,7 +158,7 @@ export class WebsocketService {
if (this.goneOffline === true) { if (this.goneOffline === true) {
this.goneOffline = false; this.goneOffline = false;
if (this.lastWant) { if (this.lastWant) {
this.want(this.lastWant); this.want(this.lastWant, true);
} }
this.stateService.connectionState$.next(2); this.stateService.connectionState$.next(2);
} }
@ -217,8 +217,8 @@ export class WebsocketService {
this.websocketSubject.next({ historicalDate }); this.websocketSubject.next({ historicalDate });
} }
want(data: string[]) { want(data: string[], force = false) {
if (data === this.lastWant) { if (data === this.lastWant && !force) {
return; return;
} }
this.websocketSubject.next({action: 'want', data: data}); this.websocketSubject.next({action: 'want', data: data});