Fixed empty search input when going from InFile to Vault

This commit is contained in:
Simon Cambier
2022-10-23 09:16:27 +02:00
parent 13cd3a7bd7
commit 62b7c7a45c
3 changed files with 5 additions and 6 deletions

View File

@@ -12,7 +12,7 @@
import { Query } from 'src/search/query'
import { settings } from '../settings'
import * as NotesIndex from '../notes-index'
import { cacheManager } from "../cache-manager"
import { cacheManager } from '../cache-manager'
export let modal: OmnisearchVaultModal
let selectedIndex = 0
@@ -31,8 +31,6 @@
}
onMount(async () => {
await NotesIndex.refreshIndex()
previousQuery = (await cacheManager.getSearchHistory())[historySearchIndex]
eventBus.enable('vault')
eventBus.on('vault', 'enter', openNoteAndCloseModal)
eventBus.on('vault', 'create-note', createNoteAndCloseModal)
@@ -43,6 +41,8 @@
eventBus.on('vault', 'arrow-down', () => moveIndex(1))
eventBus.on('vault', 'prev-search-history', prevSearchHistory)
eventBus.on('vault', 'next-search-history', nextSearchHistory)
await NotesIndex.refreshIndex()
previousQuery = (await cacheManager.getSearchHistory())[0]
})
onDestroy(() => {