fix(search): fix errors on empty titles

pull/2226/head
Divyansh Singh 2 years ago
parent 46d321fff3
commit 6d363ec9ff

@ -158,7 +158,9 @@ debouncedWatch(
title = title.replace(reg, `<mark>$&</mark>`) title = title.replace(reg, `<mark>$&</mark>`)
} }
if (match.includes('titles')) { if (match.includes('titles')) {
titles = titles.map((t) => t.replace(reg, `<mark>$&</mark>`)) titles = titles.flatMap((t) =>
t ? [t.replace(reg, `<mark>$&</mark>`)] : []
)
} }
if (showDetailedListValue && match.includes('text')) { if (showDetailedListValue && match.includes('text')) {
text = text.replace(reg, `<mark>$&</mark>`) text = text.replace(reg, `<mark>$&</mark>`)

Loading…
Cancel
Save