]> Untitled Git - lemmy-ui.git/commitdiff
Merge branch 'main' into nicer-error-hnadling
authorSleeplessOne1917 <abias1122@gmail.com>
Mon, 22 May 2023 02:44:29 +0000 (02:44 +0000)
committerGitHub <noreply@github.com>
Mon, 22 May 2023 02:44:29 +0000 (02:44 +0000)
src/shared/components/comment/comment-node.tsx

index 16e0a731640f017e235c0ed9ae83e6138e5a4f7a..d2dee1e87d522996271035bdc92d5d5c6f7bacf8 100644 (file)
@@ -42,6 +42,7 @@ import {
   colorList,
   commentTreeMaxDepth,
   futureDaysToUnixTime,
+  getCommentParentId,
   isAdmin,
   isBanned,
   isMod,
@@ -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
+    const parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id;
+
     return (
       <>
         <Link
           className={classnames}
-          to={`/comment/${cv.comment.id}`}
+          to={`/comment/${parentCommentId}`}
           title={title}
         >
           <Icon icon="link" classes="icon-inline" />