mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Gracefully handle nullish fields
This commit is contained in:
parent
2007f13ed6
commit
b2329a79b4
@ -70,7 +70,7 @@ const buildTable = (chapters) => {
|
||||
const rows = chapters.map(ch => {
|
||||
const tds = Object.values(ch).map(v => {
|
||||
const maxLength = 40;
|
||||
const shouldShrink = v.length > maxLength;
|
||||
const shouldShrink = v && v.length > maxLength;
|
||||
const content = shouldShrink ? `<span title="${v}">${v.substring(0, maxLength)}...</span><div uk-dropdown><span>${v}</span></div>` : v;
|
||||
return `<td>${content}</td>`
|
||||
}).join('');
|
||||
|
Loading…
x
Reference in New Issue
Block a user