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

It was causing the nudge to add a comment to still appear after one has just entered a comment.

Ticket: Odysee 928
This commit is contained in:
infinite-persistence 2022-03-10 22:07:41 -08:00 committed by GitHub
parent a7e70e4d21
commit 35276d5879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
} }