FIX: Move show like logic to client side (#18025)

The logic was added in commit ec8306835d,
to show the like action even if the user could not like the post. It is
not necessary for this logic to be implemented on the server side.
This commit is contained in:
Bianca Nenciu
2022-08-22 18:40:09 +03:00
committed by GitHub
parent 21abcfe5a7
commit b160331d41
3 changed files with 6 additions and 12 deletions

View File

@@ -255,9 +255,12 @@ export default function transformPost(
if (likeAction) {
postAtts.liked = likeAction.acted;
postAtts.canToggleLike = likeAction.get("canToggle");
postAtts.showLike = true;
postAtts.showLike = postAtts.liked || postAtts.canToggleLike;
postAtts.likeCount = likeAction.count;
} else if (!currentUser) {
} else if (
!currentUser ||
(topic.archived && topic.user_id !== currentUser.id)
) {
postAtts.showLike = true;
}