From 92869e529abdd41dbba8b2b332938b2953543f78 Mon Sep 17 00:00:00 2001 From: David Jay Date: Fri, 11 Nov 2016 16:27:56 -0500 Subject: [PATCH] Fixing comment count bug. --- client/coral-plugin-comment-count/CommentCount.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/coral-plugin-comment-count/CommentCount.js b/client/coral-plugin-comment-count/CommentCount.js index 47f00ffb5..6786d5c74 100644 --- a/client/coral-plugin-comment-count/CommentCount.js +++ b/client/coral-plugin-comment-count/CommentCount.js @@ -5,12 +5,12 @@ const name = 'coral-plugin-comment-count'; const CommentCount = ({items, id}) => { let count = 0; - if (items[id]) { - count += items[id].comments.length; + if (items.assets[id]) { + count += items.assets[id].comments.length; } - const itemKeys = Object.keys(items); + const itemKeys = Object.keys(items.comments); for (let i = 0; i < itemKeys.length; i++) { - const item = items[itemKeys[i]]; + const item = items.comments[itemKeys[i]]; if (item.children) { count += item.children.length; }