From 04dac6fec0a12424c5a981ac123ccc09c63a2f6c Mon Sep 17 00:00:00 2001 From: Echo Date: Mon, 27 Apr 2026 22:05:48 +0000 Subject: [PATCH] Fix TypeScript type errors - use != null to exclude both null and undefined --- frontend/src/pages/HostDetailPage.tsx | 4 ++-- frontend/src/pages/MaintenanceWindowsPage.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/HostDetailPage.tsx b/frontend/src/pages/HostDetailPage.tsx index 3c274d6..fa20541 100644 --- a/frontend/src/pages/HostDetailPage.tsx +++ b/frontend/src/pages/HostDetailPage.tsx @@ -64,11 +64,11 @@ function scheduleDescription(w: MaintenanceWindow): string { case 'daily': return `Every day at ${time} for ${dur}` case 'weekly': { - const day = w.recurrence_day !== null ? DAY_NAMES[w.recurrence_day] ?? `Day ${w.recurrence_day}` : '?' + const day = w.recurrence_day != null ? DAY_NAMES[w.recurrence_day] ?? `Day ${w.recurrence_day}` : '?' return `Every ${day} at ${time} for ${dur}` } case 'monthly': { - const day = w.recurrence_day !== null ? w.recurrence_day : '?' + const day = w.recurrence_day != null ? w.recurrence_day : '?' return `Monthly on day ${day} at ${time} for ${dur}` } } diff --git a/frontend/src/pages/MaintenanceWindowsPage.tsx b/frontend/src/pages/MaintenanceWindowsPage.tsx index ac4af3c..2f59041 100644 --- a/frontend/src/pages/MaintenanceWindowsPage.tsx +++ b/frontend/src/pages/MaintenanceWindowsPage.tsx @@ -81,11 +81,11 @@ function scheduleDescription(w: MaintenanceWindow): string { case 'daily': return `Every day at ${time} for ${dur}` case 'weekly': { - const day = w.recurrence_day !== null ? DAY_NAMES[w.recurrence_day] ?? `Day ${w.recurrence_day}` : '?' + const day = w.recurrence_day != null ? DAY_NAMES[w.recurrence_day] ?? `Day ${w.recurrence_day}` : '?' return `Every ${day} at ${time} for ${dur}` } case 'monthly': { - const day = w.recurrence_day !== null ? w.recurrence_day : '?' + const day = w.recurrence_day != null ? w.recurrence_day : '?' return `Monthly on day ${day} at ${time} for ${dur}` } }