Fix wrong comment link. Fixes #714

This commit is contained in:
Dessalines 2022-11-18 22:19:36 -05:00
parent 765ed9549a
commit 4d798a42b8

View file

@ -448,13 +448,27 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
);
}
get postLink() {
let post = this.props.post_view.post;
return (
<Link
className={!post.stickied ? "text-body" : "text-primary"}
to={`/post/${post.id}`}
title={i18n.t("comments")}
>
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
</Link>
);
}
postTitleLine() {
let post = this.props.post_view.post;
return (
<div className="post-title overflow-hidden">
<h5>
{post.url.match({
some: url => (
some: url =>
this.props.showBody ? (
<a
className={!post.stickied ? "text-body" : "text-primary"}
href={url}
@ -463,16 +477,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
>
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
</a>
) : (
this.postLink
),
none: (
<Link
className={!post.stickied ? "text-body" : "text-primary"}
to={`/post/${post.id}`}
title={i18n.t("comments")}
>
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
</Link>
),
none: this.postLink,
})}
{post.url.map(isImage).or(post.thumbnail_url).unwrapOr(false) && (
<button