Skip to content

Commit

Permalink
Local API: Fix error when a community post has no likes (#5759)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Sep 30, 2024
1 parent ca4b653 commit 9fe5d89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,8 @@ function parseLocalCommunityPost(post) {
postId: post.id,
authorThumbnails: post.author.thumbnails,
publishedTime: calculatePublishedDate(post.published.text),
voteCount: parseLocalSubscriberCount(post.vote_count.text),
// YouTube hides the vote/like count on posts when it is zero
voteCount: post.vote_count ? parseLocalSubscriberCount(post.vote_count.text) : 0,
postContent: parseLocalAttachment(post.attachment),
commentCount: replyCount,
author: post.author.name,
Expand Down

0 comments on commit 9fe5d89

Please sign in to comment.