1
0
Fork 0

fix(docsearch): don't display items when no suggestions

This commit is contained in:
François Chalifour 2020-04-16 21:56:30 +02:00
parent cdb957e990
commit 4f96cdb622
2 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@ interface ResultsProps<TItem>
export function Results<TItem extends StoredDocSearchHit>(
props: ResultsProps<TItem>
) {
if (props.suggestion.items.length === 0) {
if (!props.suggestion || props.suggestion.items.length === 0) {
return null;
}

View file

@ -48,9 +48,9 @@ export function ResultsScreen(props: ResultsScreenProps) {
>
{item.__docsearch_parent !==
suggestion.items[index + 1]?.__docsearch_parent ? (
<path d="M8 6v21M20 27H8.3"/>
) : (
<path d="M8 6v42M20 27H8.3"/>
<path d="M8 6v21M20 27H8.3" />
) : (
<path d="M8 6v42M20 27H8.3" />
)}
</g>
</svg>