kaafil-react-uikit 0.11.6 → 0.11.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.
@@ -1,9 +1,9 @@
1
1
  import { useManagerMe, useConflicts, useNotifications } from '../chunk-U6IE2UYL.js';
2
- import { FORM_FIELD_KIND_SINGLE_BOOLEAN, useChecklists, useManagers, useCloseout, useFiles, useFloat, useForms, useParties, useItinerary, useVendors, useExpenses, useCollections, useManagerToday, usePickups, useRooming, useTravellerProfile, useSeating } from '../chunk-63JQKLMH.js';
2
+ import { FORM_FIELD_KIND_SINGLE_BOOLEAN, useChecklists, useManagers, useCloseout, useFiles, useFloat, useForms, useParties, useItinerary, useVendors, useExpenses, useCollections, useManagerToday, usePickups, useRooming, useTravellerProfile, useSeating } from '../chunk-XGPX7TYV.js';
3
3
  import { useOfflineEngine } from '../chunk-RCWSMWQD.js';
4
4
  import { OfflineFallbackScreen } from '../chunk-LOLQNRIK.js';
5
5
  export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, SessionExpiredScreen } from '../chunk-LOLQNRIK.js';
6
- import { createRegistry, useKaafilChrome, useSession, tokenStyle, useOutboxStatus, useKaafilBrand } from '../chunk-YJJ4DI42.js';
6
+ import { createRegistry, useKaafilChrome, useSession, tokenStyle, useOutboxStatus, useOfflineEvent, useKaafilBrand } from '../chunk-YJJ4DI42.js';
7
7
  import { useState, useRef, useEffect, useMemo, useId } from 'react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
 
@@ -8003,7 +8003,6 @@ function ReadyManagerPickupsSection({
8003
8003
  style
8004
8004
  }) {
8005
8005
  const pickups = usePickups(tripRef);
8006
- const outbox = useOutboxStatus();
8007
8006
  const StopListUI = components?.StopList ?? StopList;
8008
8007
  const BoardingViewUI = components?.BoardingView ?? BoardingView;
8009
8008
  const [kind, setKind] = useState("PICKUP");
@@ -8027,27 +8026,13 @@ function ReadyManagerPickupsSection({
8027
8026
  cancelled = true;
8028
8027
  };
8029
8028
  }, [ready, selectedStopId, kind]);
8030
- const drainedFrom = useRef(outbox.pending);
8031
- useEffect(() => {
8032
- const hadWork = drainedFrom.current > 0;
8033
- drainedFrom.current = outbox.pending;
8034
- if (!hadWork || outbox.pending > 0) {
8035
- return;
8036
- }
8029
+ useOfflineEvent("sync.drained", () => {
8037
8030
  if (pickups.status !== "ready" || selectedStopId === void 0) {
8038
8031
  return;
8039
8032
  }
8040
- let cancelled = false;
8041
- void pickups.manifestByPickup({ kind }).then((result) => {
8042
- if (!cancelled) {
8043
- setManifest(result);
8044
- }
8045
- });
8033
+ void pickups.manifestByPickup({ kind }).then(setManifest);
8046
8034
  void pickups.refreshLive();
8047
- return () => {
8048
- cancelled = true;
8049
- };
8050
- }, [outbox.pending, selectedStopId, kind]);
8035
+ });
8051
8036
  if (pickups.status === "loading") {
8052
8037
  return /* @__PURE__ */ jsxs("div", { className: "kf-manager-pickups__skeleton", style: tokenStyle(style), children: [
8053
8038
  /* @__PURE__ */ jsx("div", { className: "kf-manager-pickups__skeleton-line" }),