From a530eaf52160647922604aed5f8ce0a09f468ae6 Mon Sep 17 00:00:00 2001 From: Ida Dittrich Date: Tue, 2 Sep 2025 07:01:59 +0200 Subject: [PATCH] fixed types --- src/hooks/useConnections.ts | 2 +- src/pages/Home/Dashboard.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hooks/useConnections.ts b/src/hooks/useConnections.ts index 4e9707d..d1f7b0f 100644 --- a/src/hooks/useConnections.ts +++ b/src/hooks/useConnections.ts @@ -106,7 +106,7 @@ export function useConnections() { setConnections(prev => prev.map(conn => conn.id === connectionId - ? { ...conn, status: 'inactive' as any, lastChecked: new Date().toISOString() } + ? { ...conn, status: 'inactive' as any, lastChecked: Math.floor(Date.now() / 1000) } : conn ) ); diff --git a/src/pages/Home/Dashboard.tsx b/src/pages/Home/Dashboard.tsx index ac6a36a..55cdcbf 100644 --- a/src/pages/Home/Dashboard.tsx +++ b/src/pages/Home/Dashboard.tsx @@ -107,7 +107,13 @@ function Dashboard() { return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]; }; - const formatDate = (dateString: string) => new Date(dateString).toLocaleString(); + const formatDate = (dateValue: string | number) => { + if (typeof dateValue === 'number') { + // Convert from seconds to milliseconds for Date constructor + return new Date(dateValue * 1000).toLocaleString(); + } + return new Date(dateValue).toLocaleString(); + }; const getStatusColor = (status: string) => { switch (status.toLowerCase()) {