@sumaris-net/ngx-components 1.23.14 → 1.23.15

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.
@@ -20886,25 +20886,32 @@
20886
20886
  if (isNil(originalData)) {
20887
20887
  console.warn('[memory-data-service] Cannot load all: no value set. Will return empty result');
20888
20888
  }
20889
- // Wait while idle
20890
- return [4 /*yield*/, this.waitWhileSaving()];
20889
+ if (!!this.started) return [3 /*break*/, 2];
20890
+ return [4 /*yield*/, this.ready()];
20891
20891
  case 1:
20892
- // Wait while idle
20893
20892
  _b.sent();
20894
- excludedDataByFilter = [];
20895
20893
  _b.label = 2;
20896
20894
  case 2:
20897
- _b.trys.push([2, , 5, 6]);
20895
+ if (!this.saving) return [3 /*break*/, 4];
20896
+ return [4 /*yield*/, this.waitWhileSaving()];
20897
+ case 3:
20898
+ _b.sent();
20899
+ _b.label = 4;
20900
+ case 4:
20901
+ excludedDataByFilter = [];
20902
+ _b.label = 5;
20903
+ case 5:
20904
+ _b.trys.push([5, , 8, 9]);
20898
20905
  if (isEmptyArray(originalData)) {
20899
20906
  return [2 /*return*/, { data: [], total: 0 }];
20900
20907
  }
20901
20908
  data = this._sortFn(originalData, sortBy, sortDirection);
20902
- if (!this._onLoad) return [3 /*break*/, 4];
20909
+ if (!this._onLoad) return [3 /*break*/, 7];
20903
20910
  return [4 /*yield*/, this._onLoad(data)];
20904
- case 3:
20911
+ case 6:
20905
20912
  data = _b.sent();
20906
- _b.label = 4;
20907
- case 4:
20913
+ _b.label = 7;
20914
+ case 7:
20908
20915
  // Apply filter (will update hiddenData)
20909
20916
  data = this.filter(data, filter, excludedDataByFilter);
20910
20917
  total = data.length;
@@ -20961,13 +20968,13 @@
20961
20968
  }); };
20962
20969
  }
20963
20970
  return [2 /*return*/, res];
20964
- case 5:
20971
+ case 8:
20965
20972
  // Remember hidden data
20966
20973
  if (offset === 0) {
20967
20974
  this._hiddenData = !excludedDataByPagination ? excludedDataByFilter : excludedDataByFilter.concat.apply(excludedDataByFilter, __spread(excludedDataByPagination));
20968
20975
  }
20969
20976
  return [7 /*endfinally*/];
20970
- case 6: return [2 /*return*/];
20977
+ case 9: return [2 /*return*/];
20971
20978
  }
20972
20979
  });
20973
20980
  });
@@ -20979,7 +20986,7 @@
20979
20986
  return this.dataSubject
20980
20987
  .pipe(operators.takeUntil(this.stopSubject),
20981
20988
  // Warn if waiting value to be set
20982
- operators.tap(function (data) { return !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }));
20989
+ operators.tap(function (data) { return _this.debug && !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }));
20983
20990
  };
20984
20991
  InMemoryEntitiesService.prototype.saveAll = function (data, options) {
20985
20992
  return __awaiter(this, void 0, void 0, function () {