Skip to content

Commit

Permalink
FIX: A reference should not be created from a document to itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
benel committed Sep 16, 2024
1 parent 7a532fb commit 0169054
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/DocumentList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ function DocumentList({ relatedTo, verb, setSelectedDocument, setShowDocumentLis
);

useEffect(() => {
backend.refreshDocuments(setUserDocuments);
}, [user, backend]);
backend.refreshDocuments(
x => setUserDocuments(
x.filter(y => y._id !== relatedTo)
)
);
}, [user, backend, relatedTo]);

return (
<>
Expand Down

0 comments on commit 0169054

Please sign in to comment.