Update health-status-modal.tsx

This commit is contained in:
MacRimi
2025-11-05 18:38:29 +01:00
parent 5b0d55c1a2
commit 876d51b009

View File

@@ -87,7 +87,9 @@ export function HealthStatusModal({ open, onOpenChange, getApiUrl }: HealthStatu
} }
} }
const groupedChecks = healthData?.checks.reduce( const groupedChecks =
healthData?.checks && Array.isArray(healthData.checks)
? healthData.checks.reduce(
(acc, check) => { (acc, check) => {
if (!acc[check.category]) { if (!acc[check.category]) {
acc[check.category] = [] acc[check.category] = []
@@ -97,6 +99,7 @@ export function HealthStatusModal({ open, onOpenChange, getApiUrl }: HealthStatu
}, },
{} as Record<string, HealthCheck[]>, {} as Record<string, HealthCheck[]>,
) )
: {}
return ( return (
<Dialog open={open} onOpenChange={onOpenChange}> <Dialog open={open} onOpenChange={onOpenChange}>