Skip to content

Commit

Permalink
Initialize discussionPosts before thread is loaded (Joystream#3236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joystream Stats committed Dec 8, 2022
1 parent 5e9ba4b commit 302aa2d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => {
const getInsertRef = (postId: string) => (ref: RefObject<HTMLDivElement>) => (postsRefs[postId] = ref)

const discussionPosts = useMemo(
() => thread.discussionPosts.filter((post) => post.status !== 'PostStatusRemoved'),
() => thread?.discussionPosts.filter((post) => post.status !== 'PostStatusRemoved') ?? [],
[thread]
)

Expand Down

0 comments on commit 302aa2d

Please sign in to comment.