diff --git a/app/assets/javascripts/utilities/buildCommentHTML.js.erb b/app/assets/javascripts/utilities/buildCommentHTML.js.erb index 0b677caee..63d49c493 100644 --- a/app/assets/javascripts/utilities/buildCommentHTML.js.erb +++ b/app/assets/javascripts/utilities/buildCommentHTML.js.erb @@ -125,12 +125,14 @@ function react(comment) { var iconSmallHeart = ``; var iconSmallHeartFilled = ``; - if (!comment.newly_created && comment.heart_ids.indexOf(userData().id) > -1) { - reactedClass = "reacted" + if (comment.newly_created) { + num = 1; + } else { + num = comment.public_reactions_count; } - if (!comment.newly_created) { - num = comment.public_reactions_count; + if (comment.newly_created || comment.heart_ids.indexOf(userData().id) > -1) { + reactedClass = "reacted" } var reactButton = `