mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 04:11:12 +00:00
Fix user mentions read.
This commit is contained in:
parent
23291cc51f
commit
9e5c955a2f
1 changed files with 8 additions and 3 deletions
|
@ -244,7 +244,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
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')
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
) : (
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
cv.comment.read && 'text-success'
|
||||
this.commentOrMentionRead && 'text-success'
|
||||
}`}
|
||||
>
|
||||
<use xlinkHref="#icon-check"></use>
|
||||
|
@ -728,6 +728,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
);
|
||||
}
|
||||
|
||||
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 (
|
||||
|
@ -965,7 +970,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
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) {
|
||||
|
|
Loading…
Reference in a new issue