aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
index 5aa0066d2..11609b1c0 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
@@ -28,10 +28,14 @@ interface PropertiesViewProps {
export class PropertiesView extends React.Component<PropertiesViewProps> {
@computed get MAX_EMBED_HEIGHT() { return 200; }
- @observable numSelected: number = SelectionManager.SelectedDocuments().length;
- @computed get selectedDocumentView() { return SelectionManager.LastSelection(); }
- @observable selectedDoc: Doc | undefined = this.selectedDocumentView?.props.Document;
- @observable dataDoc: Doc | undefined = this.selectedDocumentView?.props.DataDoc ? this.selectedDocumentView.props.DataDoc : this.selectedDoc;
+
+ @computed get selectedDocumentView() {
+ if (SelectionManger.SelectedDocuments().length) {
+ return SelectionManager.SelectedDocuments()[0];
+ } else { return undefined; }
+ }
+ @computed get selectedDoc() { return this.selectedDocumentView?.props.Document; }
+ @computed get dataDoc() { return this.selectedDocumentView?.props.DataDoc; }
@action
rtfWidth = () => {