Skip to content

Commit

Permalink
ensure search function is actually available
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Aug 31, 2023
1 parent a748c36 commit 1daba36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/templates/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ const App = ({ pageContext, children }) => {
<NestedList
items={tree.hasTopConcept}
current={pageContext.node.id}
queryFilter={query ? index.search(query) : null}
queryFilter={
query && index?.search ? index.search(query) : null
}
highlight={query ? RegExp(escapeRegExp(query), "gi") : null}
language={pageContext.language}
topLevel={true}
Expand Down

0 comments on commit 1daba36

Please sign in to comment.