Skip to content

Commit

Permalink
fix(docsearch): don't display items when no suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 16, 2020
1 parent cdb957e commit 4f96cdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ResultsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 4f96cdb

Please sign in to comment.