We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e12b098 + f918b5c commit 8afbbd9Copy full SHA for 8afbbd9
apps/web/src/hooks/useComments.tsx
@@ -79,6 +79,11 @@ export function CommentsProvider(props: Props) {
79
const onComment = (data: { documentId: string; comment: Comment }) => {
80
setState((state) => {
81
const comments = state.get(data.comment.documentId) ?? []
82
+
83
+ if (comments.some(({ id }) => id === data.comment.id)) {
84
+ return state
85
+ }
86
87
return state.set(data.comment.documentId, [...comments, data.comment])
88
})
89
}
0 commit comments