Fleet UI: Prevent software card from disappearing when no vulns detected on software (#28708)

This commit is contained in:
RachelElysia 2025-05-01 09:20:33 -04:00 committed by GitHub
parent 9767cb5c91
commit b737b3f681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(
<LastUpdatedText