From: Dessalines Date: Mon, 22 May 2023 01:30:13 +0000 (-0400) Subject: Show parent comment for comment link. Fixes #1030 (#1032) X-Git-Url: http://these/git/%22%7Burl%7D/%7B%60%24%7BghostArchiveUrl%7D/%7BjoinLemmyUrl%7D?a=commitdiff_plain;h=26de38a8695203ed6a4f85e5f11790d81595fa81;p=lemmy-ui.git Show parent comment for comment link. Fixes #1030 (#1032) * Show parent comment for comment link. Fixes #1030 * Changing let to const. --- 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 ( <>