From 654404f8f4ff8baca77500a7449e258817aac97e Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 26 Oct 2018 08:19:07 +0200 Subject: [PATCH] Client quickfix for autoupdates --- client/src/app/core/services/websocket.service.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/app/core/services/websocket.service.ts b/client/src/app/core/services/websocket.service.ts index aee2dde51..6ad8c767b 100644 --- a/client/src/app/core/services/websocket.service.ts +++ b/client/src/app/core/services/websocket.service.ts @@ -4,11 +4,13 @@ import { Observable, Subject } from 'rxjs'; import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; +type QueryParamValue = string | number | boolean; + /** * A key value mapping for params, that should be appendet to the url on a new connection. */ interface QueryParams { - [key: string]: string; + [key: string]: QueryParamValue; } /** @@ -87,7 +89,10 @@ export class WebsocketService { if (this.websocket) { return; } - const queryParams: QueryParams = {}; + const queryParams: QueryParams = { + 'change_id': 0, + 'autoupdate': true, + }; // comment-in if changes IDs are supported on server side. /*if (changeId !== undefined) { queryParams.changeId = changeId.toString(); @@ -217,9 +222,9 @@ export class WebsocketService { const keys: string[] = Object.keys(queryParams); if (keys.length > 0) { - path += keys + path += '?' + keys .map(key => { - return key + '=' + queryParams[key]; + return key + '=' + queryParams[key].toString(); }) .join('&'); }