Skip to content
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
5 changes: 4 additions & 1 deletion src/components/TechControls/SystemStatus/HealthItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const HealthItem = ({ deviceKey }: { deviceKey: string }) => {
// `communicationMonitorState` is typed as always present, but in practice it (like the rest of a
// device's state) is only populated once `/fullStatus` actually returns - chain past it too.
const state = monitor?.communicationMonitorState;
const status = (state?.status ?? 'StatusUnknown') as HealthStatus;
// The hook hands back the device's whole state, and `ICommunicationMonitorMessenger` nests the
// monitor under `commMonitor` ({ commMonitor: { isOnline, status } }). The top-level `status` the
// hook's type suggests is never sent, so reading it left every device "never online".
const status = (state?.commMonitor?.status ?? 'StatusUnknown') as HealthStatus;
const minutes = useMinutesInStatus(status);

return (
Expand Down
Loading