aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-03-05 16:17:19 -0500
committersrichman333 <sarah_n_richman@brown.edu>2024-03-05 16:17:19 -0500
commitca60236766540ac1ce0c18d52416d982e91404cd (patch)
tree77cd6195293afdf4b13dde4553c92d305b0cf7a1 /src/client/views/DocComponent.tsx
parentdfef33c3f1cde9a24d734e0bd47e7f377a3ae4c9 (diff)
parent11b6cb8344f26e5895bebc3dedef491675717e30 (diff)
Merge branch 'master' into dataviz-ai-sarah
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 3d5a5b945..2a527eca1 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -187,14 +187,14 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() {
const toRemove = value.filter(v => docs.includes(v));
if (toRemove.length !== 0) {
- const recent = this.Document !== Doc.MyRecentlyClosed ? Doc.MyRecentlyClosed : undefined;
+ const recentlyClosed = this.Document !== Doc.MyRecentlyClosed ? Doc.MyRecentlyClosed : undefined;
toRemove.forEach(doc => {
leavePushpin && DocUtils.LeavePushpin(doc, annotationKey ?? this.annotationKey);
Doc.RemoveDocFromList(targetDataDoc, annotationKey ?? this.annotationKey, doc, true);
- Doc.RemoveEmbedding(doc, doc);
doc.embedContainer = undefined;
- if (recent && !dontAddToRemoved) {
- doc.type !== DocumentType.LOADING && Doc.AddDocToList(recent, 'data', doc, undefined, true, true);
+ if (recentlyClosed && !dontAddToRemoved && doc.type !== DocumentType.LOADING) {
+ Doc.AddDocToList(recentlyClosed, 'data', doc, undefined, true, true);
+ Doc.RemoveEmbedding(doc, doc);
}
});
if (targetDataDoc.isGroup && DocListCast(targetDataDoc[annotationKey ?? this.annotationKey]).length < 2) {