From b737b3f6810b841a5d920e74c91425c0d3ea3e54 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Thu, 1 May 2025 09:20:33 -0400 Subject: [PATCH] Fleet UI: Prevent software card from disappearing when no vulns detected on software (#28708) --- frontend/pages/DashboardPage/DashboardPage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/pages/DashboardPage/DashboardPage.tsx b/frontend/pages/DashboardPage/DashboardPage.tsx index 468f6eba88..73b69b62af 100644 --- a/frontend/pages/DashboardPage/DashboardPage.tsx +++ b/frontend/pages/DashboardPage/DashboardPage.tsx @@ -330,7 +330,11 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => { keepPreviousData: true, staleTime: 30000, // stale time can be adjusted if fresher data is desired based on software inventory interval onSuccess: (data) => { - if (data.software?.length > 0) { + const hasSoftwareResults = data.software?.length > 0; + const viewingVulnSoftwareTab = softwareNavTabIndex === 1; + + // Prevent card from hiding if returns results or on-clicking vuln tab if software has no vulnerabilities + if (hasSoftwareResults || viewingVulnSoftwareTab) { setSoftwareTitleDetail && setSoftwareTitleDetail(