Fix delete documents on mongo bug (#1852)

This commit is contained in:
Laurent Nguyen 2024-06-03 15:23:09 +02:00 committed by GitHub
parent 96ba0a9729
commit 495296602a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -845,8 +845,8 @@ export const DocumentsTabComponent: React.FunctionComponent<IDocumentsTabCompone
_deleteDocuments(toDeleteDocumentIds) _deleteDocuments(toDeleteDocumentIds)
.then( .then(
(deletedIds: DocumentId[]) => { (deletedIds: DocumentId[]) => {
const deletedRids = new Set(deletedIds.map((documentId) => documentId.rid)); const deletedIdsSet = new Set(deletedIds.map((documentId) => documentId.id));
const newDocumentIds = [...documentIds.filter((documentId) => !deletedRids.has(documentId.rid))]; const newDocumentIds = [...documentIds.filter((documentId) => !deletedIdsSet.has(documentId.id))];
setDocumentIds(newDocumentIds); setDocumentIds(newDocumentIds);
setSelectedDocumentContent(undefined); setSelectedDocumentContent(undefined);