isUserIgnored() is not available on mobile
This commit is contained in:
@@ -78,7 +78,7 @@ async function search(query: Query): Promise<SearchResult[]> {
|
|||||||
|
|
||||||
// Half the score for files that are in Obsidian's excluded list
|
// Half the score for files that are in Obsidian's excluded list
|
||||||
results.forEach(result => {
|
results.forEach(result => {
|
||||||
if (app.metadataCache.isUserIgnored(result.id)) {
|
if (app.metadataCache.isUserIgnored && app.metadataCache.isUserIgnored(result.id)) {
|
||||||
result.score /= 3 // TODO: make this value configurable or toggleable?
|
result.score /= 3 // TODO: make this value configurable or toggleable?
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
2
src/types.d.ts
vendored
2
src/types.d.ts
vendored
@@ -2,6 +2,6 @@ import { type MetadataCache } from 'obsidian'
|
|||||||
|
|
||||||
declare module 'obsidian' {
|
declare module 'obsidian' {
|
||||||
interface MetadataCache {
|
interface MetadataCache {
|
||||||
isUserIgnored(path:string):boolean
|
isUserIgnored?(path: string): boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user