Skip to content

Commit

Permalink
Merge pull request #33 from Dev-R/PF-57-Minor-Pre-Deployment-Improvement
Browse files Browse the repository at this point in the history
Handle undefined for onPostLike
  • Loading branch information
Dev-R authored Oct 5, 2023
2 parents 92597b1 + f856469 commit c414f52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/core/modals/CommentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ const onCommentLiked = (commentId: PostCommentCard['id']) => {
/**
* Emit signal when a post is liked
*/
const onPostLike = (post: PostCard) => {
const onPostLike = (post: PostCard | undefined) => {
if (!post) return
post.hasLiked = !post.hasLiked
post.likeCount += post.hasLiked ? -1 : 1
}
Expand Down

0 comments on commit c414f52

Please sign in to comment.