we found 0 result

This commit is contained in:
Simon Cambier
2022-04-20 17:19:57 +02:00
parent 0d3286de04
commit 40260d46e8
3 changed files with 6 additions and 8 deletions

View File

@@ -132,7 +132,7 @@ async function openSelection(): Promise<void> {
/> />
{/each} {/each}
{:else} {:else}
We found 0 result for your search here. <center> We found 0 result for your search here. </center>
{/if} {/if}
</div> </div>
</div> </div>

View File

@@ -8,7 +8,7 @@ import { onMount, tick } from "svelte"
import CmpInput from "./CmpInput.svelte" import CmpInput from "./CmpInput.svelte"
import CmpResultNote from "./CmpResultNote.svelte" import CmpResultNote from "./CmpResultNote.svelte"
import type { ResultNote } from "./globals" import type { ResultNote } from "./globals"
import { ModalInFile, type ModalVault } from "./modal"; import { ModalInFile, type ModalVault } from "./modal"
import { openNote } from "./notes" import { openNote } from "./notes"
import { getSuggestions } from "./search" import { getSuggestions } from "./search"
import { plugin } from "./stores" import { plugin } from "./stores"
@@ -124,6 +124,9 @@ function scrollIntoView(): void {
on:click={onClick} on:click={onClick}
/> />
{/each} {/each}
{#if !resultNotes.length && searchQuery}
<center> We found 0 result for your search here. </center>
{/if}
</div> </div>
</div> </div>
<div class="prompt-instructions"> <div class="prompt-instructions">

View File

@@ -1,10 +1,6 @@
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { import { excerptAfter, excerptBefore, type ResultNote } from "./globals"
excerptAfter,
excerptBefore,
type ResultNote,
} from "./globals"
import { escapeHTML, highlighter, stringsToRegex } from "./utils" import { escapeHTML, highlighter, stringsToRegex } from "./utils"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@@ -27,7 +23,6 @@ function cleanContent(content: string): string {
} }
return escapeHTML(content) return escapeHTML(content)
} }
</script> </script>
<div <div