@resolveio/client-lib-core 0.0.13 → 0.0.15
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.
|
@@ -4336,34 +4336,30 @@ class CoreComponent extends BaseComponent {
|
|
|
4336
4336
|
this.isDevice = false;
|
|
4337
4337
|
}
|
|
4338
4338
|
let versionAlert = null;
|
|
4339
|
-
this.
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
this.
|
|
4345
|
-
|
|
4339
|
+
if (this.environment.IS_PRODUCTION && !this.environment.IS_DEV) {
|
|
4340
|
+
this._services._socket.subscribeBypassRoute('appversion').subscribe(appVersion => {
|
|
4341
|
+
if (appVersion) {
|
|
4342
|
+
this.serverVersion = appVersion.version;
|
|
4343
|
+
this._services._socket.call('setWSAppVersion', this.appVersion);
|
|
4344
|
+
if (this.appVersion < this.serverVersion) { //Reload to get new version
|
|
4345
|
+
this.invalidVersion = true;
|
|
4346
4346
|
versionAlert = this._services._alert.setAlert('error', 'Invalid version, attempting to update and will reload. If no reload takes place, please manually reload', 0);
|
|
4347
4347
|
versionAlert = this._services._alert.setAlert('warning', 'If you are having trouble removing this message, try to hold Shift key and click the reload button. If that doesn\'t work try to close all tabs and browser and reopen. Last resort - clear all browser data/cache.', 0);
|
|
4348
|
+
this._services._app.setIsInvalidVersion(true);
|
|
4348
4349
|
}
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
this._services._alert.clearAlert(versionAlert.toastId);
|
|
4350
|
+
else {
|
|
4351
|
+
if (versionAlert) {
|
|
4352
|
+
this._services._alert.clearAlert(versionAlert.toastId);
|
|
4353
|
+
}
|
|
4354
4354
|
}
|
|
4355
4355
|
}
|
|
4356
|
-
}
|
|
4357
|
-
}
|
|
4356
|
+
});
|
|
4357
|
+
}
|
|
4358
4358
|
if (this.environment.IS_PRODUCTION) {
|
|
4359
|
-
let firstTimeSWFlag = false;
|
|
4360
4359
|
this._services._socket.subscribeBypassRoute('flagWithType', 'newSW').subscribe(flag => {
|
|
4361
|
-
if (
|
|
4362
|
-
|
|
4363
|
-
this._services._alert.setAlert('info', 'This page will reload once new version has been downloaded', 0);
|
|
4364
|
-
}
|
|
4360
|
+
if (flag && this.invalidVersion) {
|
|
4361
|
+
this._services._alert.setAlert('info', 'This page will reload once new version has been downloaded', 0);
|
|
4365
4362
|
}
|
|
4366
|
-
firstTimeSWFlag = true;
|
|
4367
4363
|
});
|
|
4368
4364
|
}
|
|
4369
4365
|
this._offline.offlineMode.subscribe(offline => {
|