From deeb1d464909ae25fcf1378b047a18a054364905 Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Fri, 27 Nov 2020 14:04:58 +1300 Subject: [PATCH] other discussions. --- webapp/src/routes/[id].svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/src/routes/[id].svelte b/webapp/src/routes/[id].svelte index 6f14155..70c7b06 100644 --- a/webapp/src/routes/[id].svelte +++ b/webapp/src/routes/[id].svelte @@ -19,6 +19,7 @@ export let story; export let related; + let others = related.filter((r) => r.id !== story.id && r.num_comments); let hasComments = related.some((r) => r.num_comments); @@ -80,11 +81,11 @@ {#if hasComments}

Comments

- {#if related.length} + {#if others.length}

Other discussions: - {#each related as r} - {#if r.num_comments && r.id !== story.id} + {#each others as r} + {#if r.num_comments} {r.source} {/if} {/each}