Skip to content

Commit 6279a1b

Browse files
committed
cleanup: Items that will have comments will always have a structure where item.comments is true
1 parent 5552f13 commit 6279a1b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

components/item-full.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,19 @@ export default function ItemFull ({ item, fetchMoreComments, bio, rank, ...props
182182
? <BioItem item={item} {...props} />
183183
: <TopLevelItem item={item} {...props} />}
184184
</div>)}
185-
<div className={styles.comments}>
186-
<Comments
187-
parentId={item.id} parentCreatedAt={item.createdAt}
188-
pinned={item.position} bio={bio} commentSats={item.commentSats}
189-
ncomments={item.ncomments}
190-
comments={item.comments.comments}
191-
commentsCursor={item.comments.cursor}
192-
fetchMoreComments={fetchMoreComments}
193-
newComments={item.newComments}
194-
lastCommentAt={item.lastCommentAt}
195-
/>
196-
</div>
185+
{item.comments &&
186+
<div className={styles.comments}>
187+
<Comments
188+
parentId={item.id} parentCreatedAt={item.createdAt}
189+
pinned={item.position} bio={bio} commentSats={item.commentSats}
190+
ncomments={item.ncomments}
191+
comments={item.comments.comments}
192+
commentsCursor={item.comments.cursor}
193+
fetchMoreComments={fetchMoreComments}
194+
newComments={item.newComments}
195+
lastCommentAt={item.lastCommentAt}
196+
/>
197+
</div>}
197198
</CarouselProvider>
198199
</RootProvider>
199200
</>

0 commit comments

Comments
 (0)