Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): fix search #3829

Merged
merged 3 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ContextualSearchFilters = {
// We may want to support multiple search engines, don't couple that to Algolia/DocSearch
// Maybe users will want to use its own search engine solution
export default function useContextualSearchFilters(): ContextualSearchFilters {
const {siteConfig} = useDocusaurusContext();
const {i18n} = useDocusaurusContext();
const allDocsData = useAllDocsData();
const activePluginAndVersion = useActivePluginAndVersion();
const docsPreferredVersionByPluginId = useDocsPreferredVersionByPluginId();
Expand All @@ -46,7 +46,7 @@ export default function useContextualSearchFilters(): ContextualSearchFilters {
];

return {
locale: siteConfig.i18n.currentLocale,
locale: i18n.currentLocale,
tags,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export default function useAlgoliaContextualFacetFilters() {

const tagsFilter = tags.map((tag) => `docusaurus_tag:${tag}`);

return [...(locale ? languageFilter : []), tagsFilter];
return [languageFilter, tagsFilter];
}