Skip to content

Commit

Permalink
fix: displaying duration
Browse files Browse the repository at this point in the history
  • Loading branch information
svedova committed Mar 11, 2024
1 parent 32be612 commit 74b5a90
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ const splitLines = (message: string): string[] => {
return lines;
};

const shouldShowDuration = (
hasDurationSupport: boolean | undefined,
d: DeploymentV2,
i: number
): boolean => {
if (!hasDurationSupport) {
return false;
}

if (d.status === "running") {
return (d.logs?.length || 1) - 1 !== i;
}

return true;
};

const iconProps = {
fontSize: 12,
};
Expand Down Expand Up @@ -139,8 +155,7 @@ export default function Deployment() {
>
{title}
</Box>
{hasDurationSupport &&
!(isRunning && deployment.logs!.length - 1 !== i) ? (
{shouldShowDuration(hasDurationSupport, deployment, i) ? (
<Typography
component="span"
sx={{ color: grey[500], fontSize: 11 }}
Expand Down

0 comments on commit 74b5a90

Please sign in to comment.