From f6c6220d92b8556615f3c17463ca5b0c7452b439 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 28 Mar 2019 00:27:36 -0400
Subject: placeholder for drawing links.

---
 src/client/views/nodes/DocumentView.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/DocumentView.tsx')

diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index c31e8b8c4..108bd8e53 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -245,16 +245,18 @@ export class DocumentView extends React.Component<DocumentViewProps> {
 
             destDoc.GetTAsync(KeyStore.Prototype, Document).then((protoDest) =>
                 sourceDoc.GetTAsync(KeyStore.Prototype, Document).then((protoSrc) => runInAction(() => {
-                    let dstTarg = (protoDest ? protoDest : destDoc);
-                    let srcTarg = (protoSrc ? protoSrc : sourceDoc);
                     linkDoc.Set(KeyStore.Title, new TextField("New Link"));
                     linkDoc.Set(KeyStore.LinkDescription, new TextField(""));
                     linkDoc.Set(KeyStore.LinkTags, new TextField("Default"));
 
+                    let dstTarg = (protoDest ? protoDest : destDoc);
+                    let srcTarg = (protoSrc ? protoSrc : sourceDoc);
                     linkDoc.Set(KeyStore.LinkedToDocs, dstTarg);
                     linkDoc.Set(KeyStore.LinkedFromDocs, srcTarg);
                     dstTarg.GetOrCreateAsync(KeyStore.LinkedFromDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) })
                     srcTarg.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) })
+                    if (this.props.AddDocument)
+                        this.props.AddDocument(linkDoc, false);
                 }))
             )
             e.stopPropagation();
-- 
cgit v1.2.3-70-g09d2

