@overmap-ai/core 1.0.53-fix-outbox.5 → 1.0.53-fix-outbox.7
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.
package/dist/overmap-core.js
CHANGED
|
@@ -4642,17 +4642,7 @@ const rootReducer = (state, action) => {
|
|
|
4642
4642
|
}
|
|
4643
4643
|
return overmapReducer(mutatedState, action);
|
|
4644
4644
|
};
|
|
4645
|
-
let
|
|
4646
|
-
let __outboxCoordinator = null;
|
|
4647
|
-
const __OUTBOX_COORDINATOR_PROMISE = new Promise((resolve) => {
|
|
4648
|
-
__resolveOutboxCoordinator = resolve;
|
|
4649
|
-
}).then((coordinator) => {
|
|
4650
|
-
__outboxCoordinator = coordinator;
|
|
4651
|
-
return coordinator;
|
|
4652
|
-
});
|
|
4653
|
-
async function getOutboxCoordinator() {
|
|
4654
|
-
return await __OUTBOX_COORDINATOR_PROMISE;
|
|
4655
|
-
}
|
|
4645
|
+
let __outboxCoordinator = new OutboxCoordinator();
|
|
4656
4646
|
const useOutboxCoordinator = () => {
|
|
4657
4647
|
const [coordinator, setCoordinator] = useState(null);
|
|
4658
4648
|
const rehydrated = useAppSelector(selectRehydrated);
|
|
@@ -4665,12 +4655,8 @@ const useOutboxCoordinator = () => {
|
|
|
4665
4655
|
throw new Error("Client store not set");
|
|
4666
4656
|
}
|
|
4667
4657
|
const outbox = clientStore2.getState().offline.outbox;
|
|
4668
|
-
|
|
4669
|
-
setCoordinator(
|
|
4670
|
-
if (!__resolveOutboxCoordinator) {
|
|
4671
|
-
throw new Error("Outbox coordinator promise resolver not set");
|
|
4672
|
-
}
|
|
4673
|
-
__resolveOutboxCoordinator(coordinator2);
|
|
4658
|
+
__outboxCoordinator = OutboxCoordinator._fromOutbox(outbox);
|
|
4659
|
+
setCoordinator(__outboxCoordinator);
|
|
4674
4660
|
}, [rehydrated]);
|
|
4675
4661
|
return coordinator;
|
|
4676
4662
|
};
|
|
@@ -4686,17 +4672,11 @@ const persistCallback = (err) => {
|
|
|
4686
4672
|
};
|
|
4687
4673
|
const enqueue = (_array, item, _context) => {
|
|
4688
4674
|
const coordinator = __outboxCoordinator;
|
|
4689
|
-
if (!coordinator) {
|
|
4690
|
-
throw new Error("Outbox coordinator not set");
|
|
4691
|
-
}
|
|
4692
4675
|
coordinator.addRequest(item);
|
|
4693
4676
|
return coordinator.getQueue();
|
|
4694
4677
|
};
|
|
4695
4678
|
const dequeue = (_array, item, _context) => {
|
|
4696
4679
|
const coordinator = __outboxCoordinator;
|
|
4697
|
-
if (!coordinator) {
|
|
4698
|
-
throw new Error("Outbox coordinator not set");
|
|
4699
|
-
}
|
|
4700
4680
|
const meta = item.meta;
|
|
4701
4681
|
const uuid = meta.offlineAction.payload.uuid;
|
|
4702
4682
|
coordinator.remove(uuid);
|
|
@@ -16954,7 +16934,6 @@ export {
|
|
|
16954
16934
|
getLocalDateString,
|
|
16955
16935
|
getLocalRelativeDateString,
|
|
16956
16936
|
getMarkerCoordinates,
|
|
16957
|
-
getOutboxCoordinator,
|
|
16958
16937
|
getRenamedFile,
|
|
16959
16938
|
getStageColor,
|
|
16960
16939
|
hashFile,
|