Don't check row value - always use the column or not.

This commit is contained in:
mike12345567 2024-08-20 13:24:41 +01:00
parent 8847a5b146
commit e941491d8c
1 changed files with 2 additions and 5 deletions

View File

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