updates on the dispatch page under active section fixes

This commit is contained in:
2026-06-30 15:06:24 +05:30
parent eaab3cb83a
commit 8fd48efc23
2 changed files with 10 additions and 20 deletions

View File

@@ -2258,21 +2258,8 @@ const Dispatch = ({
btn.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
}, [selectedBatch]);
// When the user clicks a step in the focused-rider sidebar (sets focusedStop),
// surface that order in the centered popup overlay so the details show up
// without a second click. focusedStop is a slim { orderid, lat, lon }, so
// hydrate the full order out of allOrders before passing it to the popup
// (renderOrderPopupContent needs the rich timeline + status fields).
// Wait ~350ms so MapController has a chance to recenter first (matches
// the prior delay before openPopup was called).
useEffect(() => {
if (!focusedStop) return;
const t = setTimeout(() => {
const fullOrder = allOrders?.find?.((o) => String(o.orderid) === String(focusedStop.orderid));
if (fullOrder) setCenterPopupOrder(fullOrder);
}, 350);
return () => clearTimeout(t);
}, [focusedStop, allOrders]);
// Sidebar order-card clicks (setFocusedStop) only zoom the map to the stop
// the popup opens only when the user clicks the numbered marker on the map.
const startAnimation = () => {
if (isAnimating) {
@@ -4586,7 +4573,6 @@ const Dispatch = ({
getRiderColor={getRiderColor}
formatMeters={formatMeters}
isLoading={shouldFetchLive && liveIsFetching && visibleRiders.length === 0}
onMapZoom={(lat, lon) => setActiveFlyTo({ lat, lon, t: Date.now() })}
/>
) : (
visibleRiders.map(renderRiderCard)