@sumaris-net/ngx-components 1.14.0 → 1.14.1
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.
- package/bundles/sumaris-net.ngx-components.umd.js +30 -32
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/services/platform.service.js +26 -27
- package/fesm2015/sumaris-net.ngx-components.js +24 -25
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/i18n/fr.json +2 -2
|
@@ -17741,9 +17741,9 @@
|
|
|
17741
17741
|
return this.platform.height();
|
|
17742
17742
|
};
|
|
17743
17743
|
PlatformService.prototype.ngOnStart = function () {
|
|
17744
|
-
var _a
|
|
17744
|
+
var _a;
|
|
17745
17745
|
return __awaiter(this, void 0, void 0, function () {
|
|
17746
|
-
var now, storage,
|
|
17746
|
+
var now, storage, checkIntervalMs, err_1;
|
|
17747
17747
|
var _this = this;
|
|
17748
17748
|
return __generator(this, function (_d) {
|
|
17749
17749
|
switch (_d.label) {
|
|
@@ -17753,7 +17753,7 @@
|
|
|
17753
17753
|
console.info('[platform] Starting platform...');
|
|
17754
17754
|
_d.label = 1;
|
|
17755
17755
|
case 1:
|
|
17756
|
-
_d.trys.push([1,
|
|
17756
|
+
_d.trys.push([1, 8, , 9]);
|
|
17757
17757
|
this._mobile = this.is('mobile');
|
|
17758
17758
|
this._cordova = this.is('cordova');
|
|
17759
17759
|
this._android = this.is('android');
|
|
@@ -17775,7 +17775,7 @@
|
|
|
17775
17775
|
// Start root services
|
|
17776
17776
|
return [4 /*yield*/, Promise.all([
|
|
17777
17777
|
this.entitiesStorage.ready(),
|
|
17778
|
-
this.cache.ready(),
|
|
17778
|
+
this.cache.ready().then(function () { return _this.configureCache(); }),
|
|
17779
17779
|
this.settings.ready(),
|
|
17780
17780
|
this.networkService.ready(),
|
|
17781
17781
|
this.audioProvider.ready()
|
|
@@ -17783,18 +17783,17 @@
|
|
|
17783
17783
|
case 5:
|
|
17784
17784
|
// Start root services
|
|
17785
17785
|
_d.sent();
|
|
17786
|
-
return [
|
|
17787
|
-
|
|
17788
|
-
this.checkAppVersion({ canReload: true })
|
|
17789
|
-
])];
|
|
17786
|
+
if (!(this.isWeb() && this.environment.production)) return [3 /*break*/, 7];
|
|
17787
|
+
return [4 /*yield*/, this.checkAppVersion({ canReload: true })];
|
|
17790
17788
|
case 6:
|
|
17791
17789
|
_d.sent();
|
|
17790
|
+
_d.label = 7;
|
|
17791
|
+
case 7:
|
|
17792
17792
|
// Update cache configuration when network changed
|
|
17793
17793
|
this.networkService.onNetworkStatusChanges
|
|
17794
|
-
.pipe(operators.skip(1)
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
.subscribe();
|
|
17794
|
+
.pipe(operators.skip(1) // Olready done once, so we skip the first event
|
|
17795
|
+
)
|
|
17796
|
+
.subscribe(function (type) { return _this.configureCache(type !== 'none'); });
|
|
17798
17797
|
console.info("[platform] Starting platform [OK] {mobile: " + this._mobile + ", web: " + this.isWeb() + ", downloader: " + this.canDownload + ", fileOpener: " + this.canOpenFile + "} in " + (Date.now() - now) + "ms");
|
|
17799
17798
|
// Update authentication type
|
|
17800
17799
|
this.configService.config
|
|
@@ -17812,21 +17811,19 @@
|
|
|
17812
17811
|
_this.audioProvider.playStartupSound();
|
|
17813
17812
|
}, 1000);
|
|
17814
17813
|
}
|
|
17815
|
-
|
|
17816
|
-
if (this.isWeb()) {
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
(
|
|
17820
|
-
|
|
17821
|
-
.subscribe(function (_) { return _this.checkAppVersion({ silent: true, canReload: false /*do NOT auto reload, when app is started*/ }); });
|
|
17822
|
-
}
|
|
17814
|
+
checkIntervalMs = (this.environment.checkAppVersionIntervalInSeconds || 0) * 1000;
|
|
17815
|
+
if (this.isWeb() && this.environment.production && checkIntervalMs > 0) {
|
|
17816
|
+
(_a = this.checkAppVersionTimer) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
17817
|
+
this.checkAppVersionTimer = rxjs.timer(checkIntervalMs, checkIntervalMs)
|
|
17818
|
+
.subscribe(function (_) { return _this.checkAppVersion({ silent: true, canReload: false /*do NOT auto reload, when app is started*/ }); });
|
|
17819
|
+
this.registerSubscription(this.checkAppVersionTimer);
|
|
17823
17820
|
}
|
|
17824
|
-
return [3 /*break*/,
|
|
17825
|
-
case
|
|
17821
|
+
return [3 /*break*/, 9];
|
|
17822
|
+
case 8:
|
|
17826
17823
|
err_1 = _d.sent();
|
|
17827
17824
|
// Manage startup error
|
|
17828
17825
|
return [2 /*return*/, this.onStartupError(err_1)];
|
|
17829
|
-
case
|
|
17826
|
+
case 9: return [2 /*return*/];
|
|
17830
17827
|
}
|
|
17831
17828
|
});
|
|
17832
17829
|
});
|
|
@@ -17950,7 +17947,7 @@
|
|
|
17950
17947
|
PlatformService.prototype.checkAppVersion = function (opts) {
|
|
17951
17948
|
var _a, _b, _c;
|
|
17952
17949
|
return __awaiter(this, void 0, void 0, function () {
|
|
17953
|
-
var silent, production, actualVersion, peer, remoteVersion,
|
|
17950
|
+
var silent, production, canAutoReload, actualVersion, peer, remoteVersion, reloadPath;
|
|
17954
17951
|
return __generator(this, function (_d) {
|
|
17955
17952
|
switch (_d.label) {
|
|
17956
17953
|
case 0:
|
|
@@ -17958,11 +17955,12 @@
|
|
|
17958
17955
|
return [2 /*return*/]; // Skip
|
|
17959
17956
|
silent = (opts === null || opts === void 0 ? void 0 : opts.silent) === true;
|
|
17960
17957
|
production = this.environment.production;
|
|
17958
|
+
canAutoReload = !opts || opts.canReload !== false;
|
|
17961
17959
|
if (!silent)
|
|
17962
17960
|
console.info('[platform] Checking remote app version...');
|
|
17963
17961
|
actualVersion = this.environment.version;
|
|
17964
17962
|
if (isNilOrBlank(actualVersion)) {
|
|
17965
|
-
console.
|
|
17963
|
+
console.error('[platform] Missing required value for \'environment.version\'. Cannot check remote app version.');
|
|
17966
17964
|
(_a = this.checkAppVersionTimer) === null || _a === void 0 ? void 0 : _a.unsubscribe(); // Stop timer if exists
|
|
17967
17965
|
return [2 /*return*/]; // Skip
|
|
17968
17966
|
}
|
|
@@ -17981,20 +17979,20 @@
|
|
|
17981
17979
|
console.info('[platform] Checking remote app version [OK]');
|
|
17982
17980
|
return [2 /*return*/];
|
|
17983
17981
|
}
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
17982
|
+
reloadPath = location.href.replace(/[&]?version=[0-9.]+/gi, '');
|
|
17983
|
+
reloadPath += (reloadPath.indexOf('?') === -1) ? '?' : '&'; // Add query param separator
|
|
17984
|
+
reloadPath += 'version=' + remoteVersion; // Add version (to avoid a reload infinite loop)
|
|
17985
|
+
// Already try to reload, but version still bad
|
|
17986
|
+
if (reloadPath === location.href) {
|
|
17987
17987
|
if (canAutoReload)
|
|
17988
17988
|
console.error("[platform] Reloaded page failed, because version still mismatch! Please check version.appup file (expected app version: " + actualVersion + ")");
|
|
17989
|
+
// Stop timer, to avoid infinite loop
|
|
17989
17990
|
(_c = this.checkAppVersionTimer) === null || _c === void 0 ? void 0 : _c.unsubscribe();
|
|
17990
17991
|
return [2 /*return*/];
|
|
17991
17992
|
}
|
|
17992
17993
|
console.warn("[platform] More recent version detected (remote: " + remoteVersion + ", actual: " + actualVersion);
|
|
17993
|
-
reloadPath = location.href.replace(/[&?]{1}[a-z_-]=[0-9.]+/gi, '');
|
|
17994
|
-
reloadPath += (reloadPath.indexOf('?') === -1) ? '?' : '&'; // Add query param separator
|
|
17995
|
-
reloadPath += 'version=' + remoteVersion; // Add version (to avoid a reload infinite loop)
|
|
17996
|
-
console.info('[platform] Will reloading at ' + reloadPath);
|
|
17997
17994
|
if (!canAutoReload) return [3 /*break*/, 2];
|
|
17995
|
+
console.info('[platform] Will reloading at ' + reloadPath);
|
|
17998
17996
|
location.href = reloadPath;
|
|
17999
17997
|
return [3 /*break*/, 4];
|
|
18000
17998
|
case 2: return [4 /*yield*/, this.showToast({
|