Show comments that are thread replies to the issue body

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ņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2023-05-12 08:10:34 +02:00
parent 34f40fba02
commit 1df28abed2
+7 -2
View File
@@ -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,