Commit ed6aa11b authored by aleclofabbro's avatar aleclofabbro

Merge branch 'patch/filter_out_thread_with_empty_comments_edges' into develop

parents deba50a8 ad89f303
......@@ -75,11 +75,19 @@ export const CommunityPage: FC<CommunityPage> = ({ communityId, basePath }) => {
const ThreadsBox = (
<>
{threadsPage.edges.map(thread => (
<Box key={thread.id}>
<ThreadPreviewHOC threadId={thread.id} />
</Box>
))}
{threadsPage.edges.map(thread =>
thread.comments?.edges[0] ? (
<Box key={thread.id}>
<ThreadPreviewHOC threadId={thread.id} />
</Box>
) : (
(console.warn(
`Found a thread [id:${thread.id}] with an empty comments edges .. skipping`,
thread
),
null)
)
)}
</>
);
......
......@@ -19,7 +19,7 @@ export const useThreadPreview = (threadId: Thread['id']) => {
const { reply } = useReplyComment(
thread?.comments?.edges[0],
community?.id,
thread?.comments?.edges[0].creator?.userName
thread?.comments?.edges[0]?.creator?.userName
);
return useMemo(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment