updates on the dispatch page and the dispatchShared page

This commit is contained in:
2026-06-18 12:16:29 +05:30
parent 7669e259d0
commit 892f8fbc5d
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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