@onehat/data 1.15.4 → 1.15.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.15.4",
3
+ "version": "1.15.6",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -207,7 +207,8 @@ class AsyncStorageRepository extends OfflineRepository {
207
207
  }
208
208
 
209
209
  clearAll = async () => {
210
- return await this.load([]);
210
+ await this.load([]);
211
+ await this.clearLastSync();
211
212
  }
212
213
 
213
214
  getAllKeys = async () => {
@@ -407,6 +407,15 @@ class OfflineRepository extends MemoryRepository {
407
407
  await this._storageSetValue(LAST_SYNC, date);
408
408
  }
409
409
 
410
+
411
+ /**
412
+ * Clears the date when this Repository was last synced with remote.
413
+ * Used when this is the "local" side of a LocalFromRemoteRepository
414
+ */
415
+ clearLastSync = async () => {
416
+ await this._storageDeleteValue(LAST_SYNC);
417
+ }
418
+
410
419
  };
411
420
 
412
421
  OfflineRepository.className = 'Offline';
@@ -322,7 +322,7 @@ class OneBuildRepository extends AjaxRepository {
322
322
  const response = result.data;
323
323
  if (!response.success) {
324
324
  this.throwError(response.data); // TODO: Fix back-end, so OneBuild submits the error message on response.message, not response.data
325
- return;
325
+ return false;
326
326
  }
327
327
 
328
328
  const userData = response.data;