mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user