From c16488153f01fd355d36513396e30d817c7df4cb Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 21 May 2023 21:30:13 -0400 Subject: [PATCH] Show parent comment for comment link. Fixes #1030 (#1032) * Show parent comment for comment link. Fixes #1030 * Changing let to const. --- src/shared/components/comment/comment-node.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 418986d7..80e12969 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -39,6 +39,7 @@ import { colorList, commentTreeMaxDepth, futureDaysToUnixTime, + getCommentParentId, isAdmin, isBanned, isMod, @@ -1046,11 +1047,14 @@ export class CommentNode extends Component { ? i18n.t("show_context") : i18n.t("link"); + // The context button should show the parent comment by default + const parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id; + return ( <>