@overmap-ai/core 1.0.53-fix-outbox.6 → 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.
|
@@ -4632,17 +4632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4632
4632
|
}
|
|
4633
4633
|
return overmapReducer(mutatedState, action);
|
|
4634
4634
|
};
|
|
4635
|
-
let
|
|
4636
|
-
let __outboxCoordinator = null;
|
|
4637
|
-
const __OUTBOX_COORDINATOR_PROMISE = new Promise((resolve) => {
|
|
4638
|
-
__resolveOutboxCoordinator = resolve;
|
|
4639
|
-
}).then((coordinator) => {
|
|
4640
|
-
__outboxCoordinator = coordinator;
|
|
4641
|
-
return coordinator;
|
|
4642
|
-
});
|
|
4643
|
-
async function getOutboxCoordinator() {
|
|
4644
|
-
return await __OUTBOX_COORDINATOR_PROMISE;
|
|
4645
|
-
}
|
|
4635
|
+
let __outboxCoordinator = new OutboxCoordinator();
|
|
4646
4636
|
const useOutboxCoordinator = () => {
|
|
4647
4637
|
const [coordinator, setCoordinator] = React.useState(null);
|
|
4648
4638
|
const rehydrated = useAppSelector(selectRehydrated);
|
|
@@ -4655,12 +4645,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4655
4645
|
throw new Error("Client store not set");
|
|
4656
4646
|
}
|
|
4657
4647
|
const outbox = clientStore2.getState().offline.outbox;
|
|
4658
|
-
|
|
4659
|
-
setCoordinator(
|
|
4660
|
-
if (!__resolveOutboxCoordinator) {
|
|
4661
|
-
throw new Error("Outbox coordinator promise resolver not set");
|
|
4662
|
-
}
|
|
4663
|
-
__resolveOutboxCoordinator(coordinator2);
|
|
4648
|
+
__outboxCoordinator = OutboxCoordinator._fromOutbox(outbox);
|
|
4649
|
+
setCoordinator(__outboxCoordinator);
|
|
4664
4650
|
}, [rehydrated]);
|
|
4665
4651
|
return coordinator;
|
|
4666
4652
|
};
|
|
@@ -4676,17 +4662,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4676
4662
|
};
|
|
4677
4663
|
const enqueue = (_array, item, _context) => {
|
|
4678
4664
|
const coordinator = __outboxCoordinator;
|
|
4679
|
-
if (!coordinator) {
|
|
4680
|
-
throw new Error("Outbox coordinator not set");
|
|
4681
|
-
}
|
|
4682
4665
|
coordinator.addRequest(item);
|
|
4683
4666
|
return coordinator.getQueue();
|
|
4684
4667
|
};
|
|
4685
4668
|
const dequeue = (_array, item, _context) => {
|
|
4686
4669
|
const coordinator = __outboxCoordinator;
|
|
4687
|
-
if (!coordinator) {
|
|
4688
|
-
throw new Error("Outbox coordinator not set");
|
|
4689
|
-
}
|
|
4690
4670
|
const meta = item.meta;
|
|
4691
4671
|
const uuid2 = meta.offlineAction.payload.uuid;
|
|
4692
4672
|
coordinator.remove(uuid2);
|
|
@@ -5019,7 +4999,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5019
4999
|
return false;
|
|
5020
5000
|
}
|
|
5021
5001
|
function peek(_array, _item, _context) {
|
|
5022
|
-
return __outboxCoordinator
|
|
5002
|
+
return __outboxCoordinator.peek();
|
|
5023
5003
|
}
|
|
5024
5004
|
function retry(_action, _retries) {
|
|
5025
5005
|
getClientStore().dispatch(_setLatestRetryTime((/* @__PURE__ */ new Date()).getTime()));
|
|
@@ -16943,7 +16923,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16943
16923
|
exports2.getLocalDateString = getLocalDateString;
|
|
16944
16924
|
exports2.getLocalRelativeDateString = getLocalRelativeDateString;
|
|
16945
16925
|
exports2.getMarkerCoordinates = getMarkerCoordinates;
|
|
16946
|
-
exports2.getOutboxCoordinator = getOutboxCoordinator;
|
|
16947
16926
|
exports2.getRenamedFile = getRenamedFile;
|
|
16948
16927
|
exports2.getStageColor = getStageColor;
|
|
16949
16928
|
exports2.hashFile = hashFile;
|