@osovitny/anatoly 2.14.12 → 2.14.13

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.
@@ -1384,15 +1384,22 @@ class AppContextService extends BaseApiService {
1384
1384
  if (!context) {
1385
1385
  return;
1386
1386
  }
1387
- let lu = context.lastRequested;
1388
- if (lu) {
1387
+ let shouldBeUpdated = false;
1388
+ let lr = context.lastRequested;
1389
+ if (lr) {
1389
1390
  let now = new Date();
1390
1391
  let lastRequested = new Date(context.lastRequested);
1391
1392
  let in2Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 2, 0, 0);
1392
1393
  if (in2Mins.getTime() < now.getTime()) {
1393
- this.updateCurrent();
1394
+ shouldBeUpdated = true;
1394
1395
  }
1395
1396
  }
1397
+ else {
1398
+ shouldBeUpdated = true;
1399
+ }
1400
+ if (shouldBeUpdated) {
1401
+ this.updateCurrent();
1402
+ }
1396
1403
  }
1397
1404
  dataReceived(data) {
1398
1405
  this.current = data;
@@ -1441,7 +1448,6 @@ class AppContextService extends BaseApiService {
1441
1448
  return ContextInitState.isUserAdmin;
1442
1449
  }
1443
1450
  //Properties
1444
- //current
1445
1451
  get current() {
1446
1452
  this.updateCurrentIfExpired();
1447
1453
  return this.getCurrentFromSession();