From baffd11a491131a3cc2f6c4192ee56b76833bc0d Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Fri, 29 May 2026 16:29:40 +0530 Subject: [PATCH] validate step for amibiguity resolution --- src/FetchRequestDetail.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/FetchRequestDetail.tsx b/src/FetchRequestDetail.tsx index 408380c..8592213 100644 --- a/src/FetchRequestDetail.tsx +++ b/src/FetchRequestDetail.tsx @@ -65,7 +65,7 @@ function statusToActiveStep(status: FetchRequestStatus): number { case "paused": return 2; case "raw_expenses_done": return 2; case "enriched_done": return 3; - case "completed": return 4; + case "completed": return stepLabels.length; case "failed": return 0; default: return -1; } @@ -110,17 +110,15 @@ export default function FetchRequestDetail() { const dicts = source?.txn_dicts ?? []; const blockCount = typeof blocks === "object" ? Object.keys(blocks).length : Array.isArray(blocks) ? blocks.length : 0; - if (blockCount || dicts.length) { - const parts: string[] = []; - if (blockCount) parts.push(`${blockCount} blocks`); - if (dicts.length) parts.push(`${dicts.length} dicts`); - msgs[1] = parts.join(" ยท "); - } + if (blockCount) + msgs[1] = `${blockCount} blocks`; + if (dicts.length) + msgs[2] = `${dicts.length} dicts`; if (["enriched_done", "completed"].includes((fetchRequest as any)?.status)) - msgs[2] = "done"; + msgs[3] = "done"; if ((fetchRequest as any)?.status === "completed") - msgs[3] = (fetchRequest as any)?.completed_at + msgs[4] = (fetchRequest as any)?.completed_at ? new Date((fetchRequest as any).completed_at).toLocaleString() : "done"; return msgs;