@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.
@@ -3687,9 +3687,7 @@ const documentSlice = createSlice({
3687
3687
  if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
3688
3688
  throw new Error("Tried to use setIssues reducer with duplicate ID's");
3689
3689
  }
3690
- for (const document2 of action.payload) {
3691
- state.documents[document2.offline_id] = document2;
3692
- }
3690
+ state.documents = toOfflineIdRecord(action.payload);
3693
3691
  },
3694
3692
  addDocuments: (state, action) => {
3695
3693
  for (const document2 of action.payload) {
@@ -7329,7 +7327,7 @@ class DocumentService extends BaseApiService {
7329
7327
  blocks: [document2.offline_id]
7330
7328
  });
7331
7329
  promise.catch(() => {
7332
- setDocuments([documentToBeUpdated]);
7330
+ updateDocuments([documentToBeUpdated]);
7333
7331
  });
7334
7332
  const fullDocument = store.getState().documentsReducer.documents[document2.offline_id];
7335
7333
  return [fullDocument, promise];
@@ -7373,9 +7371,9 @@ class DocumentService extends BaseApiService {
7373
7371
  blocks: []
7374
7372
  });
7375
7373
  promise.then((result) => {
7376
- setDocuments(result);
7374
+ updateDocuments(result);
7377
7375
  }).catch(() => {
7378
- setDocuments(documentsToRevertIfMoveFails);
7376
+ updateDocuments(documentsToRevertIfMoveFails);
7379
7377
  });
7380
7378
  return promise;
7381
7379
  }
@@ -7400,9 +7398,9 @@ class DocumentService extends BaseApiService {
7400
7398
  promise.then((documentsToUpdate) => {
7401
7399
  store.dispatch(updateDocuments(documentsToUpdate));
7402
7400
  }).catch(() => {
7403
- store.dispatch(setDocuments([documentToBeDeleted]));
7401
+ store.dispatch(updateDocuments([documentToBeDeleted]));
7404
7402
  if (parentDocument) {
7405
- store.dispatch(setDocuments([parentDocument]));
7403
+ store.dispatch(updateDocuments([parentDocument]));
7406
7404
  }
7407
7405
  });
7408
7406
  return promise;