Skip to content

Commit bf68afb

Browse files
authored
Open text post links in new tab (if setting exists). (LemmyNet#3593)
- Fixes LemmyNet#3505
1 parent 13e8241 commit bf68afb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/shared/components/post/post-thumbnail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export function PostThumbnail({ postView, hideImage, myUserInfo }: Props) {
117117
className="text-body"
118118
to={`/post/${post.id}`}
119119
title={I18NextService.i18n.t("comments")}
120+
target={linkTarget(myUserInfo)}
120121
>
121122
<div className="thumbnail rounded bg-light d-flex justify-content-center">
122123
<Icon

src/shared/components/post/post.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
updateCommunityBlock,
1212
updatePersonBlock,
1313
editCommentsSlimLocked,
14+
linkTarget,
1415
} from "@utils/app";
1516
import { isBrowser } from "@utils/browser";
1617
import {
@@ -936,6 +937,7 @@ export class Post extends Component<PostRouteProps, PostState> {
936937
const postRes = this.state.postRes;
937938
const commentsRes = this.state.commentsRes;
938939
const siteRes = this.state.siteRes;
940+
const myUserInfo = this.isoData.myUserInfo;
939941
const commentIdFromProps = getCommentIdFromProps(this.props);
940942

941943
return (
@@ -947,6 +949,7 @@ export class Post extends Component<PostRouteProps, PostState> {
947949
<Link
948950
className="ps-0 d-block btn btn-link text-muted text-start"
949951
to={this.handleViewAllComments()}
952+
target={linkTarget(myUserInfo)}
950953
>
951954
{I18NextService.i18n.t("view_all_comments")}
952955
</Link>
@@ -959,6 +962,7 @@ export class Post extends Component<PostRouteProps, PostState> {
959962
<Link
960963
className="ps-0 d-block btn btn-link text-muted text-start"
961964
to={this.handleViewContext()}
965+
target={linkTarget(myUserInfo)}
962966
>
963967
{I18NextService.i18n.t("show_context")}
964968
</Link>

0 commit comments

Comments
 (0)