Skip to content

Commit 5b1d121

Browse files
committed
cleanup: avoid double-updating ncomments on parent
1 parent 0622689 commit 5b1d121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/show-new-comments.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function prepareComments (client, newComments) {
2929
totalNComments += (comment.ncomments || 0)
3030
}
3131

32-
// update all ancestors
33-
const ancestors = data.path.split('.')
32+
// update all ancestors, but not the item itself
33+
const ancestors = data.path.split('.').slice(0, -1)
3434
updateAncestorsCommentCount(client.cache, ancestors, totalNComments)
3535

3636
return {

0 commit comments

Comments
 (0)