Fix a bug that zero objective value is not shown

This commit is contained in:
c-bata
2021-02-22 23:08:35 +09:00
parent f508c13295
commit d1dc73e14c
@@ -235,7 +235,12 @@ const TrialTable: FC<{ studyDetail: StudyDetail | null }> = ({
}
return trials[i].values![0] < trials[j].values![0] ? 1 : -1
},
toCellValue: (i) => trials[i].values?.[0] || null,
toCellValue: (i) => {
if (trials[i].values === undefined) {
return null
}
return trials[i].values?.[0]
},
})
} else {
const objectiveColumns: DataGridColumn<
@@ -258,7 +263,12 @@ const TrialTable: FC<{ studyDetail: StudyDetail | null }> = ({
? 1
: -1
},
toCellValue: (i) => trials[i].values?.[objectiveId] || null,
toCellValue: (i) => {
if (trials[i].values === undefined) {
return null
}
return trials[i].values?.[objectiveId]
},
}))
columns.push(...objectiveColumns)
}