Skip to content

Commit

Permalink
fix: msg for completed proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Oct 10, 2024
1 parent 7a221ba commit cb9137f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/app/src/app/try/[[...slug]]/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ export function PageContent(props: ContentProps) {
}
}

function renderEstimatedTimeLeft(status: string, estimatedTimeLeft: number) {
if (status === "COMPLETED") {
return "Completed";
} else if (estimatedTimeLeft > 0) {
return estimatedTimeLeft.toFixed(1) + "s";
} else {
return "Taking longer than expected...";
}
}

function displayProofJobs() {
if (Object.keys(proofStatus).length === 0) {
return
Expand All @@ -246,7 +256,7 @@ export function PageContent(props: ContentProps) {
<TableCell><Trash className="text-red-500" onClick={() => deleteProofFromStorage(id)} /></TableCell>
<TableCell className="font-medium">{proofStatus[id].id}</TableCell>
<TableCell>{proofStatus[id].status}</TableCell>
<TableCell>{proofStatus[id].estimatedTimeLeft > 0 ? proofStatus[id].estimatedTimeLeft.toFixed(1) + "s" : "Taking longer than expected..."}</TableCell>
<TableCell>{renderEstimatedTimeLeft(proofStatus[id].status, proofStatus[id].estimatedTimeLeft)}</TableCell>
<TableCell><SimpleDialog trigger={<Button variant="link">View</Button>} title={"Error logs"} wide={true}>
<div>
<pre>{proofLogs[id] || "No logs yet"}</pre>
Expand Down

0 comments on commit cb9137f

Please sign in to comment.