From 1ef625ee863c517a5fbba21f16cf991bb77be7d7 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 18 Dec 2025 02:45:58 -0500 Subject: [PATCH] fix(error-logs-monitor): properly handle status loading state - Add isStatusLoading check to prevent false-negative rendering - Use nullish coalescing for enabled param to ensure boolean value - Component now waits for status before deciding visibility Fixes initial render returning null due to undefined status --- ui/src/components/error-logs-monitor.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/components/error-logs-monitor.tsx b/ui/src/components/error-logs-monitor.tsx index 4aeaf45a..74418e3a 100644 --- a/ui/src/components/error-logs-monitor.tsx +++ b/ui/src/components/error-logs-monitor.tsx @@ -79,11 +79,15 @@ function ErrorLogContent({ name }: { name: string }) { } export function ErrorLogsMonitor() { - const { data: status } = useCliproxyStatus(); - const { data: logs, isLoading, error } = useCliproxyErrorLogs(status?.running); + const { data: status, isLoading: isStatusLoading } = useCliproxyStatus(); + const { data: logs, isLoading, error } = useCliproxyErrorLogs(status?.running ?? false); const [expandedLog, setExpandedLog] = useState(null); - // Don't show if proxy not running or loading + // Don't show while status is loading or if proxy not running + if (isStatusLoading) { + return null; + } + if (!status?.running) { return null; }