getFiles().find() > .getAbstractFileByPath()
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
removeDiacritics,
|
removeDiacritics,
|
||||||
} from '../tools/utils'
|
} from '../tools/utils'
|
||||||
import ResultItemContainer from './ResultItemContainer.svelte'
|
import ResultItemContainer from './ResultItemContainer.svelte'
|
||||||
import { setIcon } from 'obsidian'
|
import { TFile, setIcon } from 'obsidian'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import { stringsToRegex, getMatches, makeExcerpt, highlightText } from 'src/tools/text-processing'
|
import { stringsToRegex, getMatches, makeExcerpt, highlightText } from 'src/tools/text-processing'
|
||||||
|
|
||||||
@@ -26,10 +26,8 @@
|
|||||||
$: {
|
$: {
|
||||||
imagePath = null
|
imagePath = null
|
||||||
if (isFileImage(note.path)) {
|
if (isFileImage(note.path)) {
|
||||||
// @ts-ignore
|
const file = app.vault.getAbstractFileByPath(note.path)
|
||||||
const file = app.vault.getFiles().find(f => f.path === note.path)
|
if (file instanceof TFile) {
|
||||||
if (file) {
|
|
||||||
// @ts-ignore
|
|
||||||
imagePath = app.vault.getResourcePath(file)
|
imagePath = app.vault.getResourcePath(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user