Skip to content

Commit

Permalink
feat(docsearch): display more recent searches when no favorites
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 3, 2020
1 parent 44558ec commit 164a0ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DocSearch.tsx
Expand Up @@ -57,7 +57,9 @@ export function DocSearch({
const recentSearches = React.useRef(
createStoredSearches<StoredDocSearchHit>({
key: '__DOCSEARCH_RECENT_SEARCHES__',
limit: 5,
// We display 7 recent searches and there's no favorites, but only
// 4 when there are favorites.
limit: favoriteSearches.getAll().length === 0 ? 7 : 4,
})
).current;

Expand Down

0 comments on commit 164a0ce

Please sign in to comment.