From cccfcf8aa2ff6576c9b2851232cee3778bc3dd2d Mon Sep 17 00:00:00 2001 From: Xylight Date: Sun, 20 Oct 2024 13:28:34 -0700 Subject: [PATCH] fix: thousands of function calls per seonc --- src/lib/components/lemmy/post/PostMeta.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte index b0cc8eda..eb4e3e5e 100644 --- a/src/lib/components/lemmy/post/PostMeta.svelte +++ b/src/lib/components/lemmy/post/PostMeta.svelte @@ -100,15 +100,20 @@ let displayTitle = title - $: { - if (title && tags.length == 0) { + const update = () => { + if (tags.length == 0) { const result = parseTags(title) tags = result.tags - console.log('changed display title') displayTitle = result.title } } + $: { + if (title) { + update() + } + } + let popoverOpen = false