Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show parent comment for comment link. Fixes #1030 #1032

Merged
merged 2 commits into from
May 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/shared/components/comment/comment-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
colorList,
commentTreeMaxDepth,
futureDaysToUnixTime,
getCommentParentId,
isAdmin,
isBanned,
isMod,
Expand Down Expand Up @@ -1051,11 +1052,14 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
? i18n.t("show_context")
: i18n.t("link");

// The context button should show the parent comment by default
let parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id;
dessalines marked this conversation as resolved.
Show resolved Hide resolved

return (
<>
<Link
className={classnames}
to={`/comment/${cv.comment.id}`}
to={`/comment/${parentCommentId}`}
title={title}
>
<Icon icon="link" classes="icon-inline" />
Expand Down