From 10a1bf5effda3115ccad17f98c7a267d03a8895f Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Wed, 11 May 2022 16:08:49 +0200 Subject: [PATCH] Hide matches count when 0 --- src/components/ResultItemVault.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ResultItemVault.svelte b/src/components/ResultItemVault.svelte index 5430c13..03de740 100644 --- a/src/components/ResultItemVault.svelte +++ b/src/components/ResultItemVault.svelte @@ -17,9 +17,11 @@ $: cleanedContent = makeExcerpt(note.content, note.matches[0]?.offset ?? -1) {@html note.basename.replace(reg, highlighter)} - - {matches.length} {matches.length > 1 ? "matches" : "match"} - + {#if matches.length > 0} + + {matches.length} {matches.length > 1 ? "matches" : "match"} + + {/if}
{@html cleanedContent.replace(reg, highlighter)}