Fixed #79
This commit is contained in:
@@ -28,8 +28,8 @@ $: if (searchQuery) {
|
||||
resultNotes = []
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
reindexNotes()
|
||||
onMount(async () => {
|
||||
await reindexNotes()
|
||||
searchQuery = lastSearch
|
||||
eventBus.enable("vault")
|
||||
eventBus.on("vault", "enter", openNoteAndCloseModal)
|
||||
@@ -47,7 +47,7 @@ onDestroy(() => {
|
||||
|
||||
async function updateResults() {
|
||||
query = new Query(searchQuery)
|
||||
resultNotes = await getSuggestions(query)
|
||||
resultNotes = (await getSuggestions(query)).sort((a, b) => b.score - a.score)
|
||||
lastSearch = searchQuery
|
||||
selectedIndex = 0
|
||||
scrollIntoView()
|
||||
|
||||
@@ -23,9 +23,9 @@ $: title = settings.showShortName ? note.basename : note.path
|
||||
</span>
|
||||
|
||||
{#if matches.length > 0}
|
||||
<span class="omnisearch-result__counter">
|
||||
{matches.length} {matches.length > 1 ? "matches" : "match"}
|
||||
</span>
|
||||
<span class="omnisearch-result__counter">
|
||||
{matches.length} {matches.length > 1 ? "matches" : "match"}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="omnisearch-result__body">
|
||||
|
||||
Reference in New Issue
Block a user