From 68c805dfe20cc2d77cbb2f89063e2311018b2fca Mon Sep 17 00:00:00 2001 From: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com> Date: Fri, 31 May 2024 11:03:11 -0500 Subject: [PATCH] Handle undefined `host.software` in device user UI (#19415) --- frontend/interfaces/host.ts | 2 +- frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/interfaces/host.ts b/frontend/interfaces/host.ts index 29afed9537..8b9a5a2cbf 100644 --- a/frontend/interfaces/host.ts +++ b/frontend/interfaces/host.ts @@ -301,7 +301,7 @@ export interface IHost { gigs_disk_space_available: number; labels: ILabel[]; packs: IPack[]; - software: ISoftware[]; + software?: ISoftware[]; issues: IHostIssues; status: HostStatus; display_text: string; diff --git a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx index e3f0431394..e2f2055a56 100644 --- a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx +++ b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx @@ -339,7 +339,7 @@ const DeviceUserPage = ({ // Software in the legacy response is only being used as a proxy for `iseSoftwareEnabled`. // Ideally we should be checking the config for whether software is enabled to show/hide the tab, // but it isn't available via device token authenticated API. And we need better specified empty states. - const isSoftwareEnabled = !!host?.software.length; + const isSoftwareEnabled = !!host?.software?.length; return (