Fix comment count not incremented when it was previously 0 #7510

Merged
infinite-persistence merged 1 commit from comment.increment into master 2022-03-11 07:07:42 +01:00

View file

@ -89,7 +89,7 @@ export default handleActions(
newCommentIds.unshift(comment.comment_id); newCommentIds.unshift(comment.comment_id);
byId[claimId] = newCommentIds; byId[claimId] = newCommentIds;
if (totalCommentsById[claimId]) { if (totalCommentsById.hasOwnProperty(claimId)) {
totalCommentsById[claimId] += 1; totalCommentsById[claimId] += 1;
} }
@ -562,7 +562,7 @@ export default handleActions(
} }
} }
if (totalCommentsById[claimId]) { if (totalCommentsById.hasOwnProperty(claimId)) {
totalCommentsById[claimId] = Math.max(0, totalCommentsById[claimId] - 1); totalCommentsById[claimId] = Math.max(0, totalCommentsById[claimId] - 1);
} }