isUserIgnored() is not available on mobile

This commit is contained in:
Simon Cambier
2022-05-04 20:10:19 +02:00
parent b414c2a568
commit 32181296ef
2 changed files with 2 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ async function search(query: Query): Promise<SearchResult[]> {
// Half the score for files that are in Obsidian's excluded list
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?
}
})

2
src/types.d.ts vendored
View File

@@ -2,6 +2,6 @@ import { type MetadataCache } from 'obsidian'
declare module 'obsidian' {
interface MetadataCache {
isUserIgnored(path:string):boolean
isUserIgnored?(path: string): boolean
}
}