Skip to content

Commit

Permalink
Fixed replica and container ends fields
Browse files Browse the repository at this point in the history
  • Loading branch information
satr committed Oct 22, 2024
1 parent f776c89 commit f1c4d66
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/replica/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ const ContainerDuration: FunctionComponent<{ started: Date; ended: Date }> = ({
started,
ended,
}) => {
const [now, setNow] = useState(new Date());
useInterval(() => setNow(new Date()), 1000);
const [now, setNow] = useState(new Date());

return (
<>
Expand Down Expand Up @@ -131,17 +131,13 @@ const Overview: FunctionComponent<
<>
<ReplicaDuration
created={new Date(replica.created)}
ended={
replica.endTime
? new Date(replica.endTime)
: new Date(Date.now())
}
ended={replica.endTime ? new Date(replica.endTime) : undefined}
/>
{replica.containerStarted && (
<ContainerDuration
started={new Date(replica.containerStarted)}
ended={
replica.endTime ? new Date(replica.endTime) : new Date()
replica.endTime ? new Date(replica.endTime) : undefined
}
/>
)}
Expand Down

0 comments on commit f1c4d66

Please sign in to comment.