diff --git a/src/api/reddit/index.js b/src/api/reddit/index.js index a025cdc..b810438 100644 --- a/src/api/reddit/index.js +++ b/src/api/reddit/index.js @@ -56,7 +56,7 @@ export const getParentComments = (threadID, commentID, parents) => { // If there are fewer parents than requested, remove the comments which aren't parents const idx = children.findIndex(c => c.data.id == commentID) if (idx >= 0) - children.splice(idx + 1) + children.splice(idx) return children.map(({data}) => data) }) .catch(error => errorHandler(error, 'reddit.getParentComments')) diff --git a/src/pages/thread/CommentSection.js b/src/pages/thread/CommentSection.js index c2c1d80..173a2a3 100644 --- a/src/pages/thread/CommentSection.js +++ b/src/pages/thread/CommentSection.js @@ -161,7 +161,7 @@ const commentSection = (props) => { {...comment} depth={0} postAuthor={props.postAuthor} - highlightedID={context ? root : null} + highlightedID={context && commentTree[0].id != root ? root : null} /> )) :
No comments found