@osovitny/anatoly 3.20.34 → 3.20.35

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.
@@ -1348,12 +1348,15 @@ class GoServiceBase {
1348
1348
  constructor(route, router) {
1349
1349
  this.route = route;
1350
1350
  this.router = router;
1351
+ this.initialized = false;
1351
1352
  this.isDevMode = false;
1352
- this.internalInit();
1353
1353
  }
1354
- internalInit() {
1355
- this.isDevMode = IsDevMode;
1356
- this.currentApp = getCurrentApp();
1354
+ ensureInitialized() {
1355
+ if (!this.initialized) {
1356
+ this.isDevMode = IsDevMode;
1357
+ this.currentApp = getCurrentApp();
1358
+ this.initialized = true;
1359
+ }
1357
1360
  }
1358
1361
  navigate(commands, extras, reload = false) {
1359
1362
  this.router.navigate(commands, extras).then(() => {
@@ -1363,43 +1366,53 @@ class GoServiceBase {
1363
1366
  });
1364
1367
  }
1365
1368
  getHomeUrl() {
1369
+ this.ensureInitialized();
1366
1370
  return this.currentApp.root;
1367
1371
  }
1368
1372
  locationReload() {
1369
1373
  window.location.reload();
1370
1374
  }
1371
1375
  home(reload = false) {
1376
+ this.ensureInitialized();
1372
1377
  this.navigate([this.currentApp.root], {}, reload);
1373
1378
  }
1374
1379
  dashboard(reload = false) {
1380
+ this.ensureInitialized();
1375
1381
  this.navigate([this.currentApp.root + '/dashboard'], {}, reload);
1376
1382
  }
1377
1383
  //Accounts
1378
1384
  accountClosed() {
1385
+ this.ensureInitialized();
1379
1386
  this.navigate([this.currentApp.root + '/accounts/closed']);
1380
1387
  }
1381
1388
  //Errors
1382
1389
  error() {
1390
+ this.ensureInitialized();
1383
1391
  this.navigate([this.currentApp.root + '/errors/error']);
1384
1392
  }
1385
1393
  //401 Unauthorized
1386
1394
  error401() {
1395
+ this.ensureInitialized();
1387
1396
  this.navigate([this.currentApp.root + '/errors/401']);
1388
1397
  }
1389
1398
  //402 Payment Required
1390
1399
  error402() {
1400
+ this.ensureInitialized();
1391
1401
  this.navigate([this.currentApp.root + '/errors/402']);
1392
1402
  }
1393
1403
  //403 Forbidden
1394
1404
  error403() {
1405
+ this.ensureInitialized();
1395
1406
  this.navigate([this.currentApp.root + '/errors/403']);
1396
1407
  }
1397
1408
  //404 Not Found
1398
1409
  error404() {
1410
+ this.ensureInitialized();
1399
1411
  this.navigate([this.currentApp.root + '/errors/404']);
1400
1412
  }
1401
1413
  //500 Internal Server Error
1402
1414
  error500() {
1415
+ this.ensureInitialized();
1403
1416
  this.navigate([this.currentApp.root + '/errors/500']);
1404
1417
  }
1405
1418
  static { this.ɵfac = function GoServiceBase_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GoServiceBase)(i0.ɵɵinject(i1$1.ActivatedRoute), i0.ɵɵinject(i1$1.Router)); }; }