@sumaris-net/ngx-components 2.4.0-rc4 → 2.4.0-rc6

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.
@@ -13326,11 +13326,11 @@ class LocalSettingsService extends StartableService {
13326
13326
  async restoreLocally() {
13327
13327
  let data = this._data || {};
13328
13328
  // Restore from storage
13329
- const settingsStr = await this.storage.get(SETTINGS_STORAGE_KEY);
13329
+ const settings = await this.storage.get(SETTINGS_STORAGE_KEY);
13330
13330
  // Restore local settings (or keep old settings)
13331
- if (isNotNilOrBlank(settingsStr)) {
13331
+ if (isNotNil(settings)) {
13332
13332
  console.info('[settings] Restoring previous settings...');
13333
- const restoredData = JSON.parse(settingsStr);
13333
+ const restoredData = (typeof settings === 'string') ? JSON.parse(settings) : settings;
13334
13334
  // Avoid to override transient properties
13335
13335
  SETTINGS_TRANSIENT_PROPERTIES.forEach(transientKey => {
13336
13336
  delete restoredData[transientKey];
@@ -13624,7 +13624,7 @@ class LocalSettingsService extends StartableService {
13624
13624
  }
13625
13625
  else {
13626
13626
  console.debug('[settings] Store local settings', this._data);
13627
- return this.storage.set(SETTINGS_STORAGE_KEY, JSON.stringify(this._data));
13627
+ return this.storage.set(SETTINGS_STORAGE_KEY, this._data);
13628
13628
  }
13629
13629
  }
13630
13630
  // Execute with delay
@@ -29119,13 +29119,12 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
29119
29119
  // Sometime, the service miss deletion, or GraphQl cache remove failed.
29120
29120
  // In this case, apply missing deletion using the parent delete() function
29121
29121
  const rowNotDeleted = this.getRows().filter(row => rows.includes(row));
29122
- const deleteFn = super.delete;
29123
29122
  if (isNotEmptyArray(rowNotDeleted)) {
29124
29123
  console.warn(`[entities-table-datasource] Force deletion of ${rowNotDeleted.length} rows! Please check that data service update the cache, after deletion`);
29125
- rowNotDeleted
29126
- // Start at the end
29127
- .sort((a, b) => a.id > b.id ? -1 : 1)
29128
- .forEach(r => deleteFn(r.id));
29124
+ // Start at the end
29125
+ for (const r of rowNotDeleted.sort((a, b) => a.id > b.id ? -1 : 1)) {
29126
+ await super.delete(r.id);
29127
+ }
29129
29128
  }
29130
29129
  }
29131
29130
  catch (err) {
@@ -30606,7 +30605,7 @@ class AppAsyncTable {
30606
30605
  const confirmed = (!opts || opts.interactive !== false);
30607
30606
  // Ask user confirmation, if cancel
30608
30607
  if (!confirmed && row.dirty && (this.confirmBeforeCancel || this.onBeforeCancelRows.observers.length > 0)) {
30609
- event.stopPropagation();
30608
+ event?.stopPropagation();
30610
30609
  if (!await this.canCancelRows([row], opts)) {
30611
30610
  return;
30612
30611
  }