Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Fixed notifications #1358

Merged
merged 1 commit into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions src/common/components/entry-link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class EntryLink extends Component<Props> {

const { category, author, permlink } = _entry;

if (history) {
if (history && this.props.target !== "_blank") {
history.push(makePath(category, author, permlink));
}
};
Expand All @@ -65,11 +65,12 @@ export class EntryLink extends Component<Props> {

const props = Object.assign({}, children.props, { href, onClick: this.clicked });

if (this.props.target) {
if (this.props.target === "_blank") {
props.href = "#";
props.onClick = (e: React.MouseEvent<HTMLElement>) => {
this.clicked(e);

window.open(props.href, "_blank");
window.open(href, "_blank");
};
}

Expand Down
14 changes: 7 additions & 7 deletions src/common/components/notifications/notification-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: <a className="post-link">{notification.permlink}</a>
})
)}
Expand Down Expand Up @@ -194,7 +194,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.parent_permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: <a className="post-link">{notification.parent_permlink}</a>
})
)}
Expand All @@ -216,7 +216,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: (
<div className="markdown-view mini-markdown reply-body">
{postBodySummary(notification.body, 100)}
Expand Down Expand Up @@ -249,7 +249,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: <a className="post-link">{notification.permlink}</a>
})
)}
Expand Down Expand Up @@ -277,7 +277,7 @@ export default class NotificationListItem extends Component<Props, State> {
author: notification.author,
permlink: notification.permlink
},
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
afterClick: this.afterClick,
children: <a className="post-link">{notification.permlink}</a>
})
Expand Down Expand Up @@ -307,7 +307,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: <a className="post-link">{notification.permlink}</a>
})
)}
Expand Down Expand Up @@ -354,7 +354,7 @@ export default class NotificationListItem extends Component<Props, State> {
permlink: notification.permlink
},
afterClick: this.afterClick,
target: "_blank",
...(this.props.openLinksInNewTab ? { target: "_blank" } : {}),
children: <a className="post-link">{notification.permlink}</a>
})
)}
Expand Down