fix: 修复评论详情点赞异常的问题

This commit is contained in:
曾祥俊
2024-04-08 14:16:00 +08:00
parent 7524144c3d
commit b911edb83c

View File

@ -746,6 +746,8 @@ abstract class BaseCommentAdapter(
val loginEntrance = if (isVoted) "帖子评论-取消点赞" else "帖子评论-点赞"
binding.likeCountTv.context.ifLogin(loginEntrance) {
if (isVoted) {
viewModel.unLike(comment)
} else {
viewModel.like(comment)
if (viewModel is ArticleDetailViewModel) {
@ -758,8 +760,6 @@ abstract class BaseCommentAdapter(
comment.user.id ?: "", contentType, comment.id
?: "", bbsId, bbsType
)
} else {
viewModel.unLike(comment)
}
}
}