From 66f8ab846e1b3395c5fdeaca173a345111d0e33b Mon Sep 17 00:00:00 2001 From: jeafreezy Date: Tue, 22 Oct 2024 10:13:42 +0200 Subject: [PATCH] fixes #297 --- frontend/src/components/landing/kpi/kpi.tsx | 4 ++-- .../src/features/models/components/training-history-table.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/landing/kpi/kpi.tsx b/frontend/src/components/landing/kpi/kpi.tsx index a837e0ca..af3948cd 100644 --- a/frontend/src/components/landing/kpi/kpi.tsx +++ b/frontend/src/components/landing/kpi/kpi.tsx @@ -21,7 +21,7 @@ const fetchKPIStats = async (): Promise => { }; const Kpi = () => { - const { data, isLoading,isError,error} = useQuery({ + const { data, isLoading, isError, error } = useQuery({ queryKey: ["kpis"], queryFn: fetchKPIStats, }); @@ -31,7 +31,7 @@ const Kpi = () => {

Error fetching KPI Stats

-

{(error as Error)?.message || 'An unknown error occurred.'}

+

{(error as Error)?.message || "An unknown error occurred."}

); diff --git a/frontend/src/features/models/components/training-history-table.tsx b/frontend/src/features/models/components/training-history-table.tsx index 572ba2aa..3bd8f80d 100644 --- a/frontend/src/features/models/components/training-history-table.tsx +++ b/frontend/src/features/models/components/training-history-table.tsx @@ -75,7 +75,9 @@ const columnDefinitions = ( header: APP_CONTENT.models.modelsDetailsCard.trainingHistoryTableHeader.duration, accessorFn: (row) => - formatDuration(new Date(row.started_at), new Date(row.finished_at)), + row.finished_at && row.started_at + ? formatDuration(new Date(row.started_at), new Date(row.finished_at)) + : "-", cell: (row) => ( {row.getValue() as string} ),