validate step for amibiguity resolution
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user