mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
handle undefined values, clarify comment
This commit is contained in:
@@ -4,7 +4,7 @@ import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/util
|
||||
|
||||
const useCountLinksInReplies = (comment: Comment, firstXReplies?: number) => {
|
||||
let linkCount = 0;
|
||||
const flattenedReplies = useMemo(() => flattenCommentsPages(comment.replies), [comment.replies]);
|
||||
const flattenedReplies = useMemo(() => flattenCommentsPages(comment?.replies), [comment?.replies]);
|
||||
|
||||
const repliesToConsider = firstXReplies !== undefined ? flattenedReplies.slice(0, firstXReplies) : flattenedReplies;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user