@overmap-ai/core 1.0.46-project-attachments.4 → 1.0.46-project-attachments.5

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.
@@ -3677,9 +3677,7 @@ var __publicField = (obj, key, value) => {
3677
3677
  if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
3678
3678
  throw new Error("Tried to use setIssues reducer with duplicate ID's");
3679
3679
  }
3680
- for (const document2 of action.payload) {
3681
- state.documents[document2.offline_id] = document2;
3682
- }
3680
+ state.documents = toOfflineIdRecord(action.payload);
3683
3681
  },
3684
3682
  addDocuments: (state, action) => {
3685
3683
  for (const document2 of action.payload) {
@@ -7319,7 +7317,7 @@ var __publicField = (obj, key, value) => {
7319
7317
  blocks: [document2.offline_id]
7320
7318
  });
7321
7319
  promise.catch(() => {
7322
- setDocuments([documentToBeUpdated]);
7320
+ updateDocuments([documentToBeUpdated]);
7323
7321
  });
7324
7322
  const fullDocument = store.getState().documentsReducer.documents[document2.offline_id];
7325
7323
  return [fullDocument, promise];
@@ -7363,9 +7361,9 @@ var __publicField = (obj, key, value) => {
7363
7361
  blocks: []
7364
7362
  });
7365
7363
  promise.then((result) => {
7366
- setDocuments(result);
7364
+ updateDocuments(result);
7367
7365
  }).catch(() => {
7368
- setDocuments(documentsToRevertIfMoveFails);
7366
+ updateDocuments(documentsToRevertIfMoveFails);
7369
7367
  });
7370
7368
  return promise;
7371
7369
  }
@@ -7390,9 +7388,9 @@ var __publicField = (obj, key, value) => {
7390
7388
  promise.then((documentsToUpdate) => {
7391
7389
  store.dispatch(updateDocuments(documentsToUpdate));
7392
7390
  }).catch(() => {
7393
- store.dispatch(setDocuments([documentToBeDeleted]));
7391
+ store.dispatch(updateDocuments([documentToBeDeleted]));
7394
7392
  if (parentDocument) {
7395
- store.dispatch(setDocuments([parentDocument]));
7393
+ store.dispatch(updateDocuments([parentDocument]));
7396
7394
  }
7397
7395
  });
7398
7396
  return promise;