Merge pull request #9 from zpj80231/feature/comments-liked-deleted
feat(cwd-api, widget): 实现评论取消点赞功能
This commit is contained in:
@@ -372,8 +372,12 @@ export class CommentItem extends Component {
|
||||
likedComments.add(commentId);
|
||||
this.saveLikedComments(likedComments);
|
||||
this.props.onLikeComment(commentId, true);
|
||||
} else {
|
||||
// 已点赞,执行取消点赞
|
||||
likedComments.delete(commentId);
|
||||
this.saveLikedComments(likedComments);
|
||||
this.props.onLikeComment(commentId, false);
|
||||
}
|
||||
// 已点赞则不做任何操作
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user