fix(docsearch): don't display items when no suggestions
This commit is contained in:
parent
cdb957e990
commit
4f96cdb622
2 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue