aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authoreleanor-park <eleanor_park@brown.edu>2024-07-24 16:52:50 -0400
committereleanor-park <eleanor_park@brown.edu>2024-07-24 16:52:50 -0400
commita763c4e80cec6aef5219a8c9fcfa2ddccbc10b0a (patch)
tree87bbbe2f9360525b8196f1864abc97e569d1ea97 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent9e2f51dc5a1c82e9293e04c71f4430fd67ff3378 (diff)
bug and render fixes
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index d0f65866b..f2b94fabc 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1312,7 +1312,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
this._drawing.push(inkDoc);
this.addDocument(inkDoc);
});
- const collection = containerDoc || this._marqueeViewRef.current?.collection(undefined, true, this._drawing);
+ const collection = this._marqueeViewRef.current?.collection(undefined, true, this._drawing);
if (collection) {
const docData = collection[DocData];
docData.title = opts.text.match(/^(.*?)~~~.*$/)?.[1] || opts.text;
@@ -1329,14 +1329,14 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
removeDrawing = (doc?: Doc) => {
this._batch = UndoManager.StartBatch('regenerateDrawing');
if (doc) {
- const docData = DocCast(doc[DocData]);
+ const docData = doc[DocData];
const children = DocListCast(docData.data);
+ this._props.removeDocument?.(doc);
this._props.removeDocument?.(children);
- // this._props.removeDocument?.(doc);
} else {
- this._props.removeDocument?.(this._drawing);
- // if (this._drawingContainer) this._props.removeDocument?.(this._drawingContainer);
+ if (this._drawingContainer) this._props.removeDocument?.(this._drawingContainer);
}
+ this._drawing = [];
};
@action