@sumaris-net/ngx-components 2.4.9 → 2.4.10
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/doc/changelog.md +6 -0
- package/esm2020/src/app/core/services/platform.service.mjs +12 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +12 -5
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +11 -4
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/i18n/en-US.json +1 -0
- package/src/assets/i18n/en.json +1 -0
- package/src/assets/i18n/fr.json +2 -1
|
@@ -18371,9 +18371,11 @@ class PlatformService extends StartableService {
|
|
|
18371
18371
|
const checkIntervalMs = (this.environment.checkAppVersionIntervalInSeconds || 0) * 1000;
|
|
18372
18372
|
if (this.isWeb() && this.environment.production && checkIntervalMs > 0) {
|
|
18373
18373
|
this.checkAppVersionTimer?.unsubscribe();
|
|
18374
|
-
|
|
18374
|
+
const subscription = timer(checkIntervalMs, checkIntervalMs)
|
|
18375
18375
|
.subscribe(_ => this.checkAppVersion({ silent: true, canReload: false /*do NOT auto reload, when app is started*/ }));
|
|
18376
|
-
this.
|
|
18376
|
+
this.checkAppVersionTimer = subscription;
|
|
18377
|
+
this.registerSubscription(subscription);
|
|
18378
|
+
subscription.add(() => this.unregisterSubscription(subscription));
|
|
18377
18379
|
}
|
|
18378
18380
|
}
|
|
18379
18381
|
catch (err) {
|
|
@@ -18594,13 +18596,18 @@ class PlatformService extends StartableService {
|
|
|
18594
18596
|
}
|
|
18595
18597
|
// Ask user to reload
|
|
18596
18598
|
else {
|
|
18599
|
+
// Stop timer, to avoid infinite loop
|
|
18600
|
+
this.checkAppVersionTimer?.unsubscribe();
|
|
18601
|
+
// Display a reload toast
|
|
18597
18602
|
await this.showToast({
|
|
18598
18603
|
message: 'CONFIRM.RELOAD_APP',
|
|
18599
18604
|
messageParams: { version: remoteVersion, name: this.environment.name },
|
|
18600
|
-
type: 'info',
|
|
18605
|
+
type: 'info',
|
|
18606
|
+
duration: -1,
|
|
18607
|
+
showCloseButton: true,
|
|
18601
18608
|
buttons: [
|
|
18602
18609
|
// Reload button
|
|
18603
|
-
{ text: this.translate.instant('COMMON.
|
|
18610
|
+
{ text: this.translate.instant('COMMON.BTN_UPDATE'),
|
|
18604
18611
|
side: 'end',
|
|
18605
18612
|
handler: () => {
|
|
18606
18613
|
location.href = reloadPath;
|