Commentron now includes replies for ByID request

Wasn't aware of that, and that was causing 7146 ("show replies" visible when there are no replies).
This commit is contained in:
infinite-persistence 2021-09-30 09:22:21 +08:00
parent fdd2d503d9
commit 87636fc887
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -349,9 +349,7 @@ export default handleActions(
const linkedCommentAncestors = Object.assign({}, state.linkedCommentAncestors); const linkedCommentAncestors = Object.assign({}, state.linkedCommentAncestors);
const updateStore = (comment, commentById, byId, repliesByParentId, topLevelCommentsById) => { const updateStore = (comment, commentById, byId, repliesByParentId, topLevelCommentsById) => {
// 'comment.ByID' doesn't populate 'replies'. We should have at least 1 commentById[comment.comment_id] = comment;
// at the moment, and the correct value will populated by 'comment.List'.
commentById[comment.comment_id] = { ...comment, replies: 1 };
byId[claimId] ? byId[claimId].unshift(comment.comment_id) : (byId[claimId] = [comment.comment_id]); byId[claimId] ? byId[claimId].unshift(comment.comment_id) : (byId[claimId] = [comment.comment_id]);
const parentId = comment.parent_id; const parentId = comment.parent_id;