From 1df28abed28cc8bf82a83f1f08d1374bbd5c9713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 12 May 2023 07:42:02 +0200 Subject: [PATCH] Show comments that are thread replies to the issue body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously treated the issue body as a comment and people could post a thread reply to that first comment. Now we treat the first comment as the issue body and disallow replying to it via a thread. There are still some old replies, we show them as regular comments. Signed-off-by: Rūdolfs Ošiņš --- src/views/projects/Issue.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/projects/Issue.svelte b/src/views/projects/Issue.svelte index e0d50b180..9dc1f0736 100644 --- a/src/views/projects/Issue.svelte +++ b/src/views/projects/Issue.svelte @@ -146,10 +146,15 @@ } } + const issueDescription = issue.discussion[0]; + $: selectedItem = issue.state.status === "closed" ? items[0] : items[1]; $: threads = issue.discussion - .slice(1) // Skip the first comment, which is the issue description - .filter(comment => !comment.replyTo) + .filter( + comment => + (comment.id !== issueDescription.id && !comment.replyTo) || + comment.replyTo === issueDescription.id, + ) .map(thread => { return { root: thread,