diff --git a/src/main.ts b/src/main.ts index 2927fb7..a68d364 100644 --- a/src/main.ts +++ b/src/main.ts @@ -103,7 +103,7 @@ export default class OmnisearchPlugin extends Plugin { if (isFileIndexable(file.path)) { logDebug('Renaming file', file.path) cacheManager.removeFromLiveCache(oldPath) - cacheManager.addToLiveCache(file.path) + await cacheManager.addToLiveCache(file.path) searchEngine.removeFromPaths([oldPath]) await searchEngine.addFromPaths([file.path]) } @@ -206,14 +206,14 @@ export default class OmnisearchPlugin extends Plugin { // Disable settings.useCache while writing the cache, in case it freezes settings.useCache = false - saveSettings(this) + await saveSettings(this) // Write the cache await searchEngine.writeToCache() // Re-enable settings.caching settings.useCache = true - saveSettings(this) + await saveSettings(this) } console.timeEnd('Omnisearch - Indexing total time') diff --git a/src/notes-index.ts b/src/notes-index.ts index 4a0f5cc..a6bffe5 100644 --- a/src/notes-index.ts +++ b/src/notes-index.ts @@ -43,7 +43,7 @@ export async function refreshIndex(): Promise { const paths = [...notesToReindex].map(n => n.path) if (paths.length) { searchEngine.removeFromPaths(paths) - searchEngine.addFromPaths(paths) + await searchEngine.addFromPaths(paths) notesToReindex.clear() // console.log(`Omnisearch - Reindexed ${paths.length} file(s)`) } diff --git a/src/settings.ts b/src/settings.ts index 7ddd502..8bed456 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -507,9 +507,9 @@ export class SettingsTab extends PluginSettingTab { cb.setLimits(1, 5, 0.1) .setValue(settings[key]) .setDynamicTooltip() - .onChange(v => { + .onChange(async (v) => { settings[key] = v - saveSettings(this.plugin) + await saveSettings(this.plugin) }) } }