mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-03 15:10:19 +00:00
Merge pull request #3479 from qixing-jk/fix/algolia/no-slug-error
fix(search): handle cases where slug is undefined
This commit is contained in:
@@ -104,7 +104,8 @@ export default function AlgoliaSearchModal({ cRef }) {
|
|||||||
// 跳转Search结果
|
// 跳转Search结果
|
||||||
const onJumpSearchResult = () => {
|
const onJumpSearchResult = () => {
|
||||||
if (searchResults.length > 0) {
|
if (searchResults.length > 0) {
|
||||||
window.location.href = `${siteConfig('SUB_PATH', '')}/${searchResults[activeIndex].slug}`
|
const searchResult = searchResults[activeIndex]
|
||||||
|
window.location.href = `${siteConfig('SUB_PATH', '')}/${searchResult.slug || searchResult.objectID}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user