class="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleMarkRead)}
data-tippy-content={
- cv.comment.read
+ this.commentOrMentionRead
? i18n.t('mark_as_unread')
: i18n.t('mark_as_read')
}
) : (
<svg
class={`icon icon-inline ${
- cv.comment.read && 'text-success'
+ this.commentOrMentionRead && 'text-success'
}`}
>
<use xlinkHref="#icon-check"></use>
);
}
+ get commentOrMentionRead() {
+ let cv = this.props.node.comment_view;
+ return this.isUserMentionType(cv) ? cv.user_mention.read : cv.comment.read;
+ }
+
get linkBtn() {
let cv = this.props.node.comment_view;
return (
isUserMentionType(
item: CommentView | UserMentionView
): item is UserMentionView {
- return (item as UserMentionView).user_mention.id !== undefined;
+ return (item as UserMentionView).user_mention?.id !== undefined;
}
handleMarkRead(i: CommentNode) {