Skip to content

Commit 294c7cf

Browse files
fix(docsearch): add index name to localStorage key
1 parent 8ca44b5 commit 294c7cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/DocSearchModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ export function DocSearchModal({
6969
const searchClient = useSearchClient(appId, apiKey);
7070
const favoriteSearches = React.useRef(
7171
createStoredSearches<StoredDocSearchHit>({
72-
key: '__DOCSEARCH_FAVORITE_SEARCHES__',
72+
key: `__DOCSEARCH_FAVORITE_SEARCHES__${indexName}`,
7373
limit: 10,
7474
})
7575
).current;
7676
const recentSearches = React.useRef(
7777
createStoredSearches<StoredDocSearchHit>({
78-
key: '__DOCSEARCH_RECENT_SEARCHES__',
78+
key: `__DOCSEARCH_RECENT_SEARCHES__${indexName}`,
7979
// We display 7 recent searches and there's no favorites, but only
8080
// 4 when there are favorites.
8181
limit: favoriteSearches.getAll().length === 0 ? 7 : 4,

0 commit comments

Comments
 (0)