diff --git a/ui/component/channelDiscussion/index.js b/ui/component/channelDiscussion/index.js
index df94145b5..09bb3b667 100644
--- a/ui/component/channelDiscussion/index.js
+++ b/ui/component/channelDiscussion/index.js
@@ -1,7 +1,17 @@
import { connect } from 'react-redux';
+import { withRouter } from 'react-router';
+import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
+
import ChannelDiscussion from './view';
-export default connect(
- null,
- null
-)(ChannelDiscussion);
+const select = (state, props) => {
+ const { search } = props.location;
+ const urlParams = new URLSearchParams(search);
+ const linkedCommentId = urlParams.get('lc');
+
+ return {
+ linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
+ };
+};
+
+export default withRouter(connect(select)(ChannelDiscussion));
diff --git a/ui/component/channelDiscussion/view.jsx b/ui/component/channelDiscussion/view.jsx
index 30372f543..8834da3ab 100644
--- a/ui/component/channelDiscussion/view.jsx
+++ b/ui/component/channelDiscussion/view.jsx
@@ -4,13 +4,15 @@ import CommentsList from 'component/commentsList';
type Props = {
uri: string,
+ linkedComment: ?any,
};
function ChannelDiscussion(props: Props) {
- const uri = props.uri;
+ const { uri, linkedComment } = props;
+
return (
);
}
diff --git a/ui/component/notification/view.jsx b/ui/component/notification/view.jsx
index d0f0c92c4..309c27940 100644
--- a/ui/component/notification/view.jsx
+++ b/ui/component/notification/view.jsx
@@ -6,10 +6,13 @@ import React from 'react';
import classnames from 'classnames';
import Icon from 'component/common/icon';
import DateTime from 'component/dateTime';
+import Button from 'component/button';
import ChannelThumbnail from 'component/channelThumbnail';
import { MenuItem } from '@reach/menu-button';
import { formatLbryUrlForWeb } from 'util/url';
import { useHistory } from 'react-router';
+import { parseURI } from 'lbry-redux';
+import { PAGE_VIEW_QUERY, DISCUSSION_PAGE } from 'page/channel/view';
type Props = {
notification: WebNotification,
@@ -25,10 +28,20 @@ export default function Notification(props: Props) {
const notificationTarget = notification && notification_parameters.device.target;
const commentText = notification_rule === NOTIFICATION_COMMENT && notification_parameters.dynamic.comment;
let notificationLink = formatLbryUrlForWeb(notificationTarget);
+ let urlParams = new URLSearchParams();
if (notification_rule === NOTIFICATION_COMMENT && notification_parameters.dynamic.hash) {
- notificationLink += `?lc=${notification_parameters.dynamic.hash}`;
+ urlParams.append('lc', notification_parameters.dynamic.hash);
}
+ try {
+ const { isChannel } = parseURI(notificationTarget);
+ if (isChannel) {
+ urlParams.append(PAGE_VIEW_QUERY, DISCUSSION_PAGE);
+ }
+ } catch (e) {}
+
+ notificationLink += `?${urlParams.toString()}`;
+
let icon;
switch (notification_rule) {
case NOTIFICATION_CREATOR_SUBSCRIBER:
@@ -51,6 +64,11 @@ export default function Notification(props: Props) {
}
}
+ function handleSeeNotification(e) {
+ e.stopPropagation();
+ doSeeNotifications([id]);
+ }
+
const Wrapper = menuButton
? (props: { children: any }) => (