@osovitny/anatoly 2.14.44 → 2.14.46

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.
@@ -1398,8 +1398,8 @@ class AppContextService extends BaseApiService {
1398
1398
  if (lr) {
1399
1399
  let now = new Date();
1400
1400
  let lastRequested = new Date(context.lastRequested);
1401
- let in2Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 2, 0, 0);
1402
- if (in2Mins.getTime() < now.getTime()) {
1401
+ let in3Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 3, 0, 0);
1402
+ if (in3Mins.getTime() < now.getTime()) {
1403
1403
  shouldBeUpdated = true;
1404
1404
  }
1405
1405
  }
@@ -1423,13 +1423,17 @@ class AppContextService extends BaseApiService {
1423
1423
  this.subscription = null;
1424
1424
  }
1425
1425
  //Public
1426
+ getLatestCurrent(success = null) {
1427
+ this.getCurrent(success, false);
1428
+ }
1426
1429
  getCurrent(success = null, getCachedIfExist = true) {
1427
- let context = this.getCurrentFromSession();
1428
- if (getCachedIfExist && context != null) {
1429
- if (success) {
1430
- success(context);
1430
+ if (getCachedIfExist) {
1431
+ let context = this.getCurrentFromSession();
1432
+ if (context != null) {
1433
+ if (success)
1434
+ success(context);
1435
+ return;
1431
1436
  }
1432
- return;
1433
1437
  }
1434
1438
  if (success) {
1435
1439
  this.successes.push(success);
@@ -1446,15 +1450,12 @@ class AppContextService extends BaseApiService {
1446
1450
  });
1447
1451
  }
1448
1452
  updateCurrent(success = null) {
1449
- this.getCurrent(success, false);
1453
+ this.clearCurrent();
1454
+ this.getLatestCurrent(success);
1450
1455
  }
1451
1456
  clearCurrent() {
1452
1457
  this.sessionStorage.remove(this.storageKeyName);
1453
1458
  }
1454
- refreshCurrent() {
1455
- this.clearCurrent();
1456
- this.updateCurrent();
1457
- }
1458
1459
  //Properties
1459
1460
  get current() {
1460
1461
  this.updateCurrentIfExpired();