diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/DocComponent.tsx | 3 | ||||
-rw-r--r-- | src/client/views/collections/CollectionView.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index f453b02b8..a05bfc302 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -127,12 +127,13 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T const targetDataDoc = this.dataDoc; const value = DocListCast(targetDataDoc[this.annotationKey]); const toRemove = value.filter(v => docs.includes(v)); - // can't assign new List<Doc>(result) to this because you can't assign new values in addonly + if (toRemove.length !== 0) { const recent = Cast(Doc.UserDoc().myRecentlyClosed, Doc) as Doc; toRemove.forEach(doc => { Doc.RemoveDocFromList(targetDataDoc, this.props.fieldKey, doc); recent && Doc.AddDocToList(recent, "data", doc, undefined, true, true); + doc.deleted = true; }); return true; } diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 852826ebc..555db7e1a 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -203,6 +203,7 @@ export class CollectionView extends Touchable<FieldViewProps & CollectionViewCus toRemove.forEach(doc => { Doc.RemoveDocFromList(targetDataDoc, this.props.fieldKey, doc); recent && Doc.AddDocToList(recent, "data", doc, undefined, true, true); + doc.deleted = true; }); return true; } diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index af9967942..7d2c34b2b 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -573,8 +573,6 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu const selected = SelectionManager.SelectedDocuments().slice(); SelectionManager.DeselectAll(); selected.map(dv => dv.props.removeDocument?.(dv.props.Document)); - - this.props.Document.deleted = true; this.props.removeDocument?.(this.props.Document); } } @@ -768,8 +766,6 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu Doc.AreProtosEqual(this.props.Document, Doc.UserDoc()) && moreItems.push({ description: "Toggle Always Show Link End", event: () => Doc.UserDoc()["documentLinksButton-hideEnd"] = !Doc.UserDoc()["documentLinksButton-hideEnd"], icon: "eye" }); } - // const effectiveAcl = GetEffectiveAcl(this.props.Document); - // (effectiveAcl === AclEdit || effectiveAcl === AclAdmin) && moreItems.push({ description: "Close", event: this.deleteClicked, icon: "trash" }); !more && cm.addItem({ description: "More...", subitems: moreItems, icon: "hand-point-right" }); |