This commit is contained in:
IndieKKY
2024-10-04 00:07:11 +08:00
parent f50a2e3abd
commit abb97813d1
4 changed files with 8 additions and 9 deletions

View File

@@ -42,14 +42,14 @@ const useSearchService = () => {
// search text
useEffect(() => {
const searchResult: Set<number> = new Set()
const searchResult: Record<string, boolean> = {}
if (envData.searchEnabled && searchText) {
// @ts-expect-error
const documents: Document[] | undefined = search(searchText)
if (documents != null) {
for (const document of documents) {
searchResult.add(document.idx)
searchResult[''+document.idx] = true
}
}
}