@arsedizioni/ars-utils 19.0.158 → 19.0.159

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.
@@ -2218,16 +2218,15 @@ class ClipperSearchResultManager extends ClipperDocumentManager {
2218
2218
  else if (this.hasAnySelection()) {
2219
2219
  documentIds = this.selection?.all?.map(n => n.documentId);
2220
2220
  }
2221
- console.log("set read: " + documentIds.length);
2222
2221
  return this.clipperService.updateState({ documentIds: documentIds, isRead: value })
2223
2222
  .subscribe(r => {
2224
2223
  if (r.success) {
2225
- let changed = 0;
2226
2224
  if (item) {
2227
2225
  if (item.isRead !== value) {
2228
2226
  item.isRead = value;
2229
2227
  this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: item, value: value });
2230
- changed++;
2228
+ this.clipperService.updateUnreadItems(ClipperUtils.getClipperModuleFromModel(item), item.model, value ? -1 : 1);
2229
+ this.changeDetector.markForCheck();
2231
2230
  }
2232
2231
  }
2233
2232
  else if (this.hasAnySelection()) {
@@ -2235,16 +2234,11 @@ class ClipperSearchResultManager extends ClipperDocumentManager {
2235
2234
  if (n.isRead !== value) {
2236
2235
  n.isRead = value;
2237
2236
  this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: n, value: value });
2238
- changed++;
2237
+ this.clipperService.updateUnreadItems(ClipperUtils.getClipperModuleFromModel(n), n.model, value ? -1 : 1);
2238
+ this.changeDetector.markForCheck();
2239
2239
  }
2240
2240
  });
2241
2241
  }
2242
- // Update dashboard
2243
- if (changed > 0) {
2244
- console.log("changed: " + changed);
2245
- this.clipperService.updateUnreadItems(ClipperUtils.getClipperModuleFromModel(item), item.model, value ? -1 : 1);
2246
- this.changeDetector.markForCheck();
2247
- }
2248
2242
  }
2249
2243
  });
2250
2244
  }