From 35276d587957668f6fa1247fe88daddd631fd7e5 Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Thu, 10 Mar 2022 22:07:41 -0800 Subject: [PATCH] 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 --- ui/redux/reducers/comments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/redux/reducers/comments.js b/ui/redux/reducers/comments.js index 1a8733c8d..0031f5d15 100644 --- a/ui/redux/reducers/comments.js +++ b/ui/redux/reducers/comments.js @@ -89,7 +89,7 @@ export default handleActions( newCommentIds.unshift(comment.comment_id); byId[claimId] = newCommentIds; - if (totalCommentsById[claimId]) { + if (totalCommentsById.hasOwnProperty(claimId)) { 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); }