@onehat/data 1.19.7 → 1.19.8
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/package.json
CHANGED
|
@@ -30,7 +30,9 @@ class SecureLocalStorageRepository extends LocalStorageRepository {
|
|
|
30
30
|
|
|
31
31
|
// BEGIN MOD
|
|
32
32
|
let result = this._store(name);
|
|
33
|
-
|
|
33
|
+
if (!_.isEmpty(result)) {
|
|
34
|
+
result = AES.decrypt(result, this.passphrase);
|
|
35
|
+
}
|
|
34
36
|
// END MOD
|
|
35
37
|
|
|
36
38
|
if (this.debugMode) {
|
|
@@ -25,7 +25,9 @@ class SecureSessionStorageRepository extends SessionStorageRepository {
|
|
|
25
25
|
|
|
26
26
|
// BEGIN MOD
|
|
27
27
|
let result = this._store.session(name);
|
|
28
|
-
|
|
28
|
+
if (!_.isEmpty(result)) {
|
|
29
|
+
result = AES.decrypt(result, this.passphrase);
|
|
30
|
+
}
|
|
29
31
|
// END MOD
|
|
30
32
|
|
|
31
33
|
let value;
|
|
@@ -84,10 +84,6 @@ class OfflineRepository extends MemoryRepository {
|
|
|
84
84
|
try {
|
|
85
85
|
|
|
86
86
|
this._index = await this._getIndex();
|
|
87
|
-
if (!this._index) {
|
|
88
|
-
await this._setIndex([]);
|
|
89
|
-
this._index = [];
|
|
90
|
-
}
|
|
91
87
|
|
|
92
88
|
const ids = this._index,
|
|
93
89
|
total = ids && ids.length ? ids.length : 0,
|
|
@@ -299,7 +295,13 @@ class OfflineRepository extends MemoryRepository {
|
|
|
299
295
|
* @private
|
|
300
296
|
*/
|
|
301
297
|
_getIndex = async () => {
|
|
302
|
-
return await this._storageGetValue('index');
|
|
298
|
+
// return await this._storageGetValue('index');
|
|
299
|
+
let result = await this._storageGetValue('index');
|
|
300
|
+
if (!result) {
|
|
301
|
+
await this._setIndex([]);
|
|
302
|
+
result = [];
|
|
303
|
+
}
|
|
304
|
+
return result;
|
|
303
305
|
}
|
|
304
306
|
|
|
305
307
|
/**
|