@osovitny/anatoly 2.1.11 → 2.1.12
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/bundles/osovitny-anatoly.umd.js +13 -6
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/esm2015/lib/core/services/appcontext.service.js +14 -7
- package/fesm2015/osovitny-anatoly.js +13 -6
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/services/appcontext.service.d.ts +2 -0
- package/osovitny-anatoly.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1650,8 +1650,15 @@
|
|
|
1650
1650
|
_this.baseUrl = '/api/appContext';
|
|
1651
1651
|
return _this;
|
|
1652
1652
|
}
|
|
1653
|
+
//Session
|
|
1654
|
+
AppContextService.prototype.getCurrentFromSession = function () {
|
|
1655
|
+
return this.sessionStorage.getObject(this.storageKeyName);
|
|
1656
|
+
};
|
|
1657
|
+
AppContextService.prototype.setCurrentFromSession = function (value) {
|
|
1658
|
+
this.sessionStorage.setObject(this.storageKeyName, value);
|
|
1659
|
+
};
|
|
1653
1660
|
AppContextService.prototype.updateCurrentIfExpired = function () {
|
|
1654
|
-
var context = this.
|
|
1661
|
+
var context = this.getCurrentFromSession();
|
|
1655
1662
|
if (!context) {
|
|
1656
1663
|
return;
|
|
1657
1664
|
}
|
|
@@ -1681,10 +1688,10 @@
|
|
|
1681
1688
|
var _this = this;
|
|
1682
1689
|
if (success === void 0) { success = null; }
|
|
1683
1690
|
if (getCachedIfExist === void 0) { getCachedIfExist = true; }
|
|
1684
|
-
var
|
|
1685
|
-
if (getCachedIfExist &&
|
|
1691
|
+
var context = this.getCurrentFromSession();
|
|
1692
|
+
if (getCachedIfExist && context != null) {
|
|
1686
1693
|
if (success) {
|
|
1687
|
-
success(
|
|
1694
|
+
success(context);
|
|
1688
1695
|
}
|
|
1689
1696
|
return;
|
|
1690
1697
|
}
|
|
@@ -1719,10 +1726,10 @@
|
|
|
1719
1726
|
//current
|
|
1720
1727
|
get: function () {
|
|
1721
1728
|
this.updateCurrentIfExpired();
|
|
1722
|
-
return this.
|
|
1729
|
+
return this.getCurrentFromSession();
|
|
1723
1730
|
},
|
|
1724
1731
|
set: function (value) {
|
|
1725
|
-
this.
|
|
1732
|
+
this.setCurrentFromSession(value);
|
|
1726
1733
|
},
|
|
1727
1734
|
enumerable: false,
|
|
1728
1735
|
configurable: true
|