feat(docsearch): display more recent searches when no favorites
This commit is contained in:
parent
44558ec1f9
commit
164a0ce8f0
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue