From 290190ea5787c875fbf888020e3539d6bc5851a6 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 11 Mar 2022 12:09:18 +0800 Subject: [PATCH] Fix comment count not incremented when it was previously 0 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); } -- 2.45.3