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.
1 parent 92c12b3 commit f918b5cCopy full SHA for f918b5c
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