Skip to content

Commit 51e9d33

Browse files
fix empty availability print case
1 parent d1e7ea0 commit 51e9d33

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

web/frontend/src/generic/select/MetricSelection.svelte

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,19 @@
8888
8989
function printAvailability(metric, cluster) {
9090
const avail = globalMetrics.find((gm) => gm.name === metric)?.availability
91-
if (!cluster) {
92-
return avail.map((av) => av.cluster).join(', ')
93-
} else {
94-
const subAvail = avail.find((av) => av.cluster === cluster)?.subClusters
95-
if (subAvail) {
96-
return subAvail.join(', ')
91+
if (avail) {
92+
if (!cluster) {
93+
return avail.map((av) => av.cluster).join(', ')
9794
} else {
98-
return `Not available for ${cluster}`
95+
const subAvail = avail.find((av) => av.cluster === cluster)?.subClusters
96+
if (subAvail) {
97+
return subAvail.join(', ')
98+
} else {
99+
return `Not available for ${cluster}`
100+
}
99101
}
100102
}
103+
return ""
101104
}
102105
103106
function columnsDragOver(event) {

0 commit comments

Comments
 (0)