From 5d349153d25d993a13c9215cd83080f9d00a6d15 Mon Sep 17 00:00:00 2001 From: bennykok Date: Thu, 1 Feb 2024 18:30:57 +0800 Subject: [PATCH] fix: if timestamp is undefined skip rendering --- web/src/components/LogsViewer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/LogsViewer.tsx b/web/src/components/LogsViewer.tsx index 5b94ce0..1cb9a9a 100644 --- a/web/src/components/LogsViewer.tsx +++ b/web/src/components/LogsViewer.tsx @@ -7,7 +7,7 @@ import { toast } from "sonner"; export type LogsType = { machine_id?: string; logs: string; - timestamp: number; + timestamp?: number; }[]; export function LogsViewer({ @@ -65,7 +65,7 @@ export function LogsViewer({ navigator.clipboard.writeText(x.logs); }} > - {!hideTimestamp && ( + {!hideTimestamp && x.timestamp != undefined && ( <> {new Date(x.timestamp * 1000).toLocaleString()}