From 26de38a8695203ed6a4f85e5f11790d81595fa81 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 16e0a73..d2dee1e 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -42,6 +42,7 @@ import { colorList, commentTreeMaxDepth, futureDaysToUnixTime, + getCommentParentId, isAdmin, isBanned, isMod, @@ -1051,11 +1052,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 ( <> -- 2.44.1