mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +00:00
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
This commit is contained in:
@@ -79,11 +79,15 @@ function ErrorLogContent({ name }: { name: string }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ErrorLogsMonitor() {
|
export function ErrorLogsMonitor() {
|
||||||
const { data: status } = useCliproxyStatus();
|
const { data: status, isLoading: isStatusLoading } = useCliproxyStatus();
|
||||||
const { data: logs, isLoading, error } = useCliproxyErrorLogs(status?.running);
|
const { data: logs, isLoading, error } = useCliproxyErrorLogs(status?.running ?? false);
|
||||||
const [expandedLog, setExpandedLog] = useState<string | null>(null);
|
const [expandedLog, setExpandedLog] = useState<string | null>(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) {
|
if (!status?.running) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user