@etsoo/appscript 1.2.68 → 1.2.69

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.
@@ -727,10 +727,18 @@ class CoreApp {
727
727
  doRefreshTokenResult(result, initCallCallback, silent = false) {
728
728
  if (result === true)
729
729
  return;
730
- if (initCallCallback &&
731
- typeof result === 'object' &&
730
+ if (typeof result === 'object' &&
732
731
  !(result instanceof restclient_1.ApiDataError) &&
733
732
  this.checkDeviceResult(result)) {
733
+ initCallCallback !== null && initCallCallback !== void 0 ? initCallCallback : (initCallCallback = (result) => {
734
+ var _a;
735
+ if (!result)
736
+ return;
737
+ this.notifier.alert((_a = this.get('environmentChanged')) !== null && _a !== void 0 ? _a : 'Environment changed', () => {
738
+ // Reload the page
739
+ history.go(0);
740
+ });
741
+ });
734
742
  this.initCall(initCallCallback, true);
735
743
  return;
736
744
  }
@@ -724,10 +724,18 @@ export class CoreApp {
724
724
  doRefreshTokenResult(result, initCallCallback, silent = false) {
725
725
  if (result === true)
726
726
  return;
727
- if (initCallCallback &&
728
- typeof result === 'object' &&
727
+ if (typeof result === 'object' &&
729
728
  !(result instanceof ApiDataError) &&
730
729
  this.checkDeviceResult(result)) {
730
+ initCallCallback !== null && initCallCallback !== void 0 ? initCallCallback : (initCallCallback = (result) => {
731
+ var _a;
732
+ if (!result)
733
+ return;
734
+ this.notifier.alert((_a = this.get('environmentChanged')) !== null && _a !== void 0 ? _a : 'Environment changed', () => {
735
+ // Reload the page
736
+ history.go(0);
737
+ });
738
+ });
731
739
  this.initCall(initCallCallback, true);
732
740
  return;
733
741
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.68",
3
+ "version": "1.2.69",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -1470,11 +1470,22 @@ export abstract class CoreApp<
1470
1470
  if (result === true) return;
1471
1471
 
1472
1472
  if (
1473
- initCallCallback &&
1474
1473
  typeof result === 'object' &&
1475
1474
  !(result instanceof ApiDataError) &&
1476
1475
  this.checkDeviceResult(result)
1477
1476
  ) {
1477
+ initCallCallback ??= (result) => {
1478
+ if (!result) return;
1479
+ this.notifier.alert(
1480
+ this.get<string>('environmentChanged') ??
1481
+ 'Environment changed',
1482
+ () => {
1483
+ // Reload the page
1484
+ history.go(0);
1485
+ }
1486
+ );
1487
+ };
1488
+
1478
1489
  this.initCall(initCallCallback, true);
1479
1490
  return;
1480
1491
  }