Client quickfix for autoupdates
This commit is contained in:
parent
bd8ea6fb5b
commit
654404f8f4
@ -4,11 +4,13 @@ import { Observable, Subject } from 'rxjs';
|
|||||||
import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material';
|
import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
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.
|
* A key value mapping for params, that should be appendet to the url on a new connection.
|
||||||
*/
|
*/
|
||||||
interface QueryParams {
|
interface QueryParams {
|
||||||
[key: string]: string;
|
[key: string]: QueryParamValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +89,10 @@ export class WebsocketService {
|
|||||||
if (this.websocket) {
|
if (this.websocket) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const queryParams: QueryParams = {};
|
const queryParams: QueryParams = {
|
||||||
|
'change_id': 0,
|
||||||
|
'autoupdate': true,
|
||||||
|
};
|
||||||
// comment-in if changes IDs are supported on server side.
|
// comment-in if changes IDs are supported on server side.
|
||||||
/*if (changeId !== undefined) {
|
/*if (changeId !== undefined) {
|
||||||
queryParams.changeId = changeId.toString();
|
queryParams.changeId = changeId.toString();
|
||||||
@ -217,9 +222,9 @@ export class WebsocketService {
|
|||||||
|
|
||||||
const keys: string[] = Object.keys(queryParams);
|
const keys: string[] = Object.keys(queryParams);
|
||||||
if (keys.length > 0) {
|
if (keys.length > 0) {
|
||||||
path += keys
|
path += '?' + keys
|
||||||
.map(key => {
|
.map(key => {
|
||||||
return key + '=' + queryParams[key];
|
return key + '=' + queryParams[key].toString();
|
||||||
})
|
})
|
||||||
.join('&');
|
.join('&');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user