Merge pull request #9 from zpj80231/feature/comments-liked-deleted

feat(cwd-api, widget): 实现评论取消点赞功能
This commit is contained in:
anghunk
2026-03-26 10:00:59 +08:00
committed by GitHub
3 changed files with 17 additions and 17 deletions

View File

@@ -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);
}
// 已点赞则不做任何操作
}
/**