Merge pull request #3947 from FinnStutzenstein/changeIdQuickfix

Client quickfix for autoupdates
This commit is contained in:
Finn Stutzenstein 2018-10-26 08:24:02 +02:00 committed by GitHub
commit 95fab6b991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -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('&');
}