updates on the dispatch page under active section

This commit is contained in:
2026-06-30 16:30:25 +05:30
parent 8fd48efc23
commit 7ad980692f
3 changed files with 122 additions and 136 deletions

View File

@@ -29,12 +29,12 @@ export const getStatusStyle = (status) =>
export const FINAL_STATUSES = new Set(['delivered']);
export const SKIPPED_STATUSES = new Set(['cancelled', 'skipped']);
// An order is "active" (currently in progress) when it's neither completed
// (delivered) nor skipped/cancelled. The Active view uses this to collapse a
// rider down to the single delivery they're working on right now.
// An order is "active" (currently in progress) when its status is exactly
// 'active'. The Active view uses this to collapse a 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