wt-front-shared 1.0.87 → 1.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6412,7 +6412,7 @@ var WebsocketMessageSubTypes;
6412
6412
  })(WebsocketMessageSubTypes || (WebsocketMessageSubTypes = {}));
6413
6413
  ;
6414
6414
  class WebsocketService {
6415
- constructor(config, staticDataFacade, cookieService) {
6415
+ constructor(config, platformId, staticDataFacade, cookieService) {
6416
6416
  this.config = config;
6417
6417
  this.staticDataFacade = staticDataFacade;
6418
6418
  this.cookieService = cookieService;
@@ -6421,11 +6421,12 @@ class WebsocketService {
6421
6421
  this.numbersOfReloads = 0;
6422
6422
  this.messageQueue = [];
6423
6423
  this.storageKey = 'wt-user-key';
6424
+ this.isBrowser = isPlatformBrowser(platformId);
6424
6425
  this.connectToWebSocket();
6425
6426
  this.sendMessageFromQueueTimer();
6426
6427
  }
6427
6428
  connectToWebSocket() {
6428
- if ('WebSocket' in window) {
6429
+ if (this.isBrowser && window && 'WebSocket' in window) {
6429
6430
  this.ws = new WebSocket(this.config.websocketUrl);
6430
6431
  const storageData = this.getUserKey();
6431
6432
  this.ws.onopen = () => {
@@ -6523,7 +6524,7 @@ class WebsocketService {
6523
6524
  }
6524
6525
  }
6525
6526
  }
6526
- WebsocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, deps: [{ token: CORE_CONFIG }, { token: StaticDataFacade }, { token: i2$1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
6527
+ WebsocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, deps: [{ token: CORE_CONFIG }, { token: PLATFORM_ID }, { token: StaticDataFacade }, { token: i2$1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
6527
6528
  WebsocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, providedIn: 'root' });
6528
6529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, decorators: [{
6529
6530
  type: Injectable,
@@ -6533,6 +6534,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
6533
6534
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
6534
6535
  type: Inject,
6535
6536
  args: [CORE_CONFIG]
6537
+ }] }, { type: Object, decorators: [{
6538
+ type: Inject,
6539
+ args: [PLATFORM_ID]
6536
6540
  }] }, { type: StaticDataFacade }, { type: i2$1.CookieService }]; } });
6537
6541
 
6538
6542
  class RouterFacade {