Fix some minor context-related edge cases

This commit is contained in:
Christopher Gurnee 2022-05-22 14:46:04 +00:00
parent ccfb452bce
commit 981c06fb73
2 changed files with 2 additions and 2 deletions

View file

@ -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'))

View file

@ -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}
/>
))
: <p>No comments found</p>