Skip to content

Commit 239901c

Browse files
authored
Fleet view fix undefined app page crash (stolostron#3974)
Signed-off-by: zlayne <zlayne@redhat.com>
1 parent 11232dc commit 239901c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/routes/Home/Overview/OverviewPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ export default function OverviewPage(props: Readonly<{ selectedClusterLabels: Re
130130
}, [selectedClusterLabels])
131131

132132
const allClusters: Cluster[] = useAllClusters(true /* exclude unclaimed cluster pool clusters */)
133-
console.log(allClusters)
134133
const filteredClusters = useMemo(
135134
() => getFilteredClusters(allClusters, selectedClusterLabels),
136135
[allClusters, selectedClusterLabels]

frontend/src/routes/Home/Overview/overviewDataFunctions.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ export function getAppTypeSummary(requestedCounts: IResultStatuses, t: TFunction
154154
}
155155
}
156156
const typeTotals: Record<string, number> = {}
157-
Object.keys(filterCounts.type).forEach((type) => {
158-
typeTotals[getAppTypeLabel(type)] = filterCounts.type[type]
159-
})
157+
// type can be undefined just after ACM is installed.
158+
if (filterCounts.type) {
159+
Object.keys(filterCounts.type).forEach((type) => {
160+
typeTotals[getAppTypeLabel(type)] = filterCounts.type[type]
161+
})
162+
}
160163
// sort alphabetically
161164
const orderedAppTypes = Object.keys(typeTotals).sort((a, b) => compareStrings(a, b))
162165

0 commit comments

Comments
 (0)