mirror of
https://github.com/wassname/talk.git
synced 2026-08-01 13:00:55 +08:00
Fixing comment count bug.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user