#53 - Fixed some highlighting issues

This commit is contained in:
Simon Cambier
2022-06-08 21:54:27 +02:00
parent 3cfad5c414
commit 8f954a3cda
4 changed files with 33 additions and 26 deletions

View File

@@ -22,16 +22,19 @@ export function resetNotesCache(): void {
}
export async function loadNotesCache(): Promise<void> {
if (settings.storeIndexInFile && await app.vault.adapter.exists(notesCacheFilePath)) {
if (
settings.storeIndexInFile &&
(await app.vault.adapter.exists(notesCacheFilePath))
) {
try {
const json = await app.vault.adapter.read(notesCacheFilePath)
notesCache = JSON.parse(json)
console.log('Notes cache loaded from the file')
}
catch(e) {
catch (e) {
console.trace('Could not load Notes cache from the file')
console.error(e)
}
}
}
if (!notesCache) {