@fayz-ai/pos 0.26.0 → 0.26.1

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/index.js CHANGED
@@ -8070,6 +8070,12 @@ function PosScreen({
8070
8070
  return { ...p, itemCount: counts[p.id] ?? p.itemCount, totalCents: totalCents || p.totalCents };
8071
8071
  }), [positions, opened, dispatched, settled, book, counts, config.serviceChargePercent, minhas]);
8072
8072
  const activePosition = livePositions.find((p) => p.id === activePositionId);
8073
+ useEffect(() => {
8074
+ if (!activePositionId || activePosition || loading) return;
8075
+ setActivePositionId(void 0);
8076
+ setSelectedLineId(void 0);
8077
+ setRailOpen(false);
8078
+ }, [activePositionId, activePosition, loading]);
8073
8079
  const activeIdRef = useRef(activePositionId);
8074
8080
  activeIdRef.current = activePositionId;
8075
8081
  const activeKindRef = useRef(activePosition?.kind);
@@ -8432,15 +8438,16 @@ function PosScreen({
8432
8438
  const onLocationChangeRef = useRef(onLocationChange);
8433
8439
  onLocationChangeRef.current = onLocationChange;
8434
8440
  const railMenuId = canalMarcado ?? menuId;
8441
+ const historyShown = deliveryHistory && !activePosition;
8435
8442
  const addressedPositionId = activePositionId ?? restoringId;
8436
8443
  useEffect(() => {
8437
8444
  onLocationChangeRef.current?.({
8438
8445
  menuId: railMenuId,
8439
8446
  positionId: addressedPositionId,
8440
- deliveryHistory: deliveryHistory || void 0,
8447
+ deliveryHistory: historyShown || void 0,
8441
8448
  floorLayout: floorLayout === "plan" ? "plan" : void 0
8442
8449
  });
8443
- }, [railMenuId, addressedPositionId, deliveryHistory, floorLayout]);
8450
+ }, [railMenuId, addressedPositionId, historyShown, floorLayout]);
8444
8451
  const [editandoPlanta, setEditandoPlanta] = useState(false);
8445
8452
  const [salvandoPlanta, setSalvandoPlanta] = useState(false);
8446
8453
  const [mesaNaFicha, setMesaNaFicha] = useState();