Skip to content

fix(site): handle null warnings in health page #10775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions site/src/pages/HealthPage/HealthPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export function HealthPageView({
{healthStatus.healthy
? Object.keys(sections).some(
(key) =>
healthStatus[key as keyof typeof sections]?.warnings
healthStatus[key as keyof typeof sections].warnings !==
null &&
healthStatus[key as keyof typeof sections].warnings
.length > 0,
)
? "All systems operational, but performance might be degraded"
Expand Down Expand Up @@ -163,7 +165,7 @@ export function HealthPageView({
const healthSection =
healthStatus[key as keyof typeof sections];
const isHealthy = healthSection.healthy;
const isWarning = healthSection.warnings.length > 0;
const isWarning = healthSection.warnings?.length > 0;
return (
<Box
component="button"
Expand Down