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
1 changed files with 2 additions and 2 deletions

View File

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