PR comments.

This commit is contained in:
mike12345567 2024-08-20 13:27:20 +01:00
parent e941491d8c
commit ff855a677a
1 changed files with 2 additions and 2 deletions

View File

@ -229,12 +229,12 @@ function getPrimaryDisplayValue(row: Row, table?: Table) {
invalid = INVALID_DISPLAY_COLUMN_TYPE.includes(primaryDisplaySchema.type)
}
if (invalid || !primaryDisplay) {
const validKey = Object.keys(table?.schema || {}).filter(
const validKey = Object.keys(table?.schema || {}).find(
key =>
table?.schema[key].type &&
!INVALID_DISPLAY_COLUMN_TYPE.includes(table?.schema[key].type)
)
return validKey[0] ? row[validKey[0]] : undefined
return validKey ? row[validKey] : undefined
} else {
return row[primaryDisplay]
}