Handle undefined host.software in device user UI (#19415)

This commit is contained in:
Sarah Gillespie 2024-05-31 11:03:11 -05:00 committed by GitHub
parent 893766efdd
commit 68c805dfe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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 (
<div className="core-wrapper">