@resolveio/client-lib-core 0.0.10 → 0.0.12

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.
@@ -1123,7 +1123,7 @@ class SocketManagerService {
1123
1123
  this._socket.onmessage = (event) => {
1124
1124
  let resData = JSON.parse(event.data, dateReviver);
1125
1125
  if (resData.data === 'reloadWSCommand') {
1126
- window.location.href = window.location.href;
1126
+ window.location.href = window.location.href + '?forceReload=true';
1127
1127
  }
1128
1128
  else if (resData.data === 'reconnectWSCommand') {
1129
1129
  this._socket.reconnect();
@@ -4356,10 +4356,11 @@ class CoreComponent extends BaseComponent {
4356
4356
  }
4357
4357
  });
4358
4358
  if (this.environment.IS_PRODUCTION) {
4359
+ let firstTimeSWFlag = false;
4359
4360
  this._services._socket.subscribeBypassRoute('flagWithType', 'newSW').subscribe(flag => {
4360
- if (flag) {
4361
+ if (firstTimeSWFlag && flag) {
4361
4362
  if (!this.invalidVersion) {
4362
- let count = 30;
4363
+ let count = 15;
4363
4364
  let interval = setInterval(() => {
4364
4365
  if (count <= 0) {
4365
4366
  clearInterval(interval);
@@ -4369,6 +4370,7 @@ class CoreComponent extends BaseComponent {
4369
4370
  }, 1000);
4370
4371
  }
4371
4372
  }
4373
+ firstTimeSWFlag = true;
4372
4374
  });
4373
4375
  }
4374
4376
  this._offline.offlineMode.subscribe(offline => {