Skip to content

Commit 0c58834

Browse files
committed
hotfix: isThread should be recognized when an item has 2 items in its path
1 parent 5f0ca6c commit 0c58834

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/show-new-comments.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ function collectAllNewComments (item) {
7676
return allNewComments
7777
}
7878

79+
// TODO: Fix bug where new comments out of depth are not shown
7980
export function ShowNewComments ({ sort, comments, newComments = [], itemId, item, setHasNewComments }) {
8081
const client = useApolloClient()
8182

8283
const topLevel = !!sort
8384
// if item is provided, we're showing all new comments for a thread,
8485
// otherwise we're showing new comments for a comment
85-
const isThread = !!item
86+
const isThread = item.path.split('.').length === 2
8687
const allNewComments = useMemo(() => {
8788
if (isThread) {
8889
return collectAllNewComments(item)

0 commit comments

Comments
 (0)