Don't check row value - always use the column or not.
This commit is contained in:
parent
8847a5b146
commit
e941491d8c
|
@ -226,16 +226,13 @@ function getPrimaryDisplayValue(row: Row, table?: Table) {
|
||||||
let invalid = true
|
let invalid = true
|
||||||
if (primaryDisplay) {
|
if (primaryDisplay) {
|
||||||
const primaryDisplaySchema = table?.schema[primaryDisplay]
|
const primaryDisplaySchema = table?.schema[primaryDisplay]
|
||||||
invalid =
|
invalid = INVALID_DISPLAY_COLUMN_TYPE.includes(primaryDisplaySchema.type)
|
||||||
INVALID_DISPLAY_COLUMN_TYPE.includes(primaryDisplaySchema.type) &&
|
|
||||||
row[primaryDisplay]
|
|
||||||
}
|
}
|
||||||
if (invalid || !primaryDisplay) {
|
if (invalid || !primaryDisplay) {
|
||||||
const validKey = Object.keys(table?.schema || {}).filter(
|
const validKey = Object.keys(table?.schema || {}).filter(
|
||||||
key =>
|
key =>
|
||||||
table?.schema[key].type &&
|
table?.schema[key].type &&
|
||||||
!INVALID_DISPLAY_COLUMN_TYPE.includes(table?.schema[key].type) &&
|
!INVALID_DISPLAY_COLUMN_TYPE.includes(table?.schema[key].type)
|
||||||
row[key]
|
|
||||||
)
|
)
|
||||||
return validKey[0] ? row[validKey[0]] : undefined
|
return validKey[0] ? row[validKey[0]] : undefined
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue