diff --git a/src/pages/nearle/dispatch/Dispatch.js b/src/pages/nearle/dispatch/Dispatch.js index 036a6a9..9bff09b 100644 --- a/src/pages/nearle/dispatch/Dispatch.js +++ b/src/pages/nearle/dispatch/Dispatch.js @@ -1493,7 +1493,7 @@ const Dispatch = ({ // show ONLY currently-active riders — their cards, routes, drop markers and // live bike markers — and hide everyone who is offline/idle for the slot. const activeRiderIdSet = useMemo( - () => new Set(liveRiderLocations.filter((r) => r.status === 'active').map((r) => String(r.id))), + () => new Set(liveRiderLocations.filter((r) => r.status === 'active' || r.status === 'pending').map((r) => String(r.id))), [liveRiderLocations] ); // Default to the slot containing the current wall-clock time. Use a @@ -1896,7 +1896,7 @@ const Dispatch = ({ () => isAllActiveView ? liveRiderLocations - .filter((r) => r.status === 'active' && activeOrderRiderIdSet.has(String(r.id))) + .filter((r) => (r.status === 'active' || r.status === 'pending') && activeOrderRiderIdSet.has(String(r.id))) .map((r) => [r.lat, r.lon]) : [], [isAllActiveView, liveRiderLocations, activeOrderRiderIdSet] @@ -4940,12 +4940,12 @@ const Dispatch = ({ {liveRiderLocations .filter((r) => isAllActiveView - ? (r.status === 'active' && activeOrderRiderIdSet.has(String(r.id))) + ? ((r.status === 'active' || r.status === 'pending') && activeOrderRiderIdSet.has(String(r.id))) : riders.some((rd) => String(rd.id) === String(r.id)) ) .filter((r) => !focusedRider || String(focusedRider.id) === String(r.id)) .map((r) => { - const isActive = r.status === 'active'; + const isActive = r.status === 'active' || r.status === 'pending'; const pinColor = isActive ? '#16a34a' : '#dc2626'; // Look up the rider's in-progress order so the popup can show // where they're heading next (drop customer/area + originating diff --git a/src/pages/nearle/dispatch/dispatchShared.js b/src/pages/nearle/dispatch/dispatchShared.js index 3d8cf0b..3559d4e 100644 --- a/src/pages/nearle/dispatch/dispatchShared.js +++ b/src/pages/nearle/dispatch/dispatchShared.js @@ -69,7 +69,7 @@ export const ordinal = (n) => { // rider down to the single delivery they're working on right now. export const isActiveDelivery = (o) => { const s = String(o?.orderstatus || '').toLowerCase(); - return !FINAL_STATUSES.has(s) && !SKIPPED_STATUSES.has(s); + return s === 'active'; }; // A rider's single in-progress delivery: the first non-final, non-skipped