From 8f95d52ed2b93930716ab6ed0ba9aab5c438876c Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Wed, 22 Jul 2020 20:16:53 -0400
Subject: fixed document download/import to capture links as well.

---
 .../collections/collectionFreeForm/CollectionFreeFormView.tsx      | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 412f91417..bee9e7009 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -46,6 +46,8 @@ import "./CollectionFreeFormView.scss";
 import MarqueeOptionsMenu from "./MarqueeOptionsMenu";
 import { MarqueeView } from "./MarqueeView";
 import React = require("react");
+import { SearchUtil } from "../../../util/SearchUtil";
+import { LinkManager } from "../../../util/LinkManager";
 
 library.add(faEye as any, faTable, faPaintBrush, faExpandArrowsAlt, faCompressArrowsAlt, faCompass, faUpload, faBraille, faChalkboard, faFileUpload);
 
@@ -1276,6 +1278,11 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
                                     const [xx, yy] = this.props.ScreenToLocalTransform().transformPoint(x, y);
                                     doc.x = xx, doc.y = yy;
                                     this.props.addDocument?.(doc);
+                                    setTimeout(() => {
+                                        SearchUtil.Search(`{!join from=id to=proto_i}id:link*`, true, {}).then(docs => {
+                                            docs.docs.forEach(d => LinkManager.Instance.addLink(d));
+                                        })
+                                    }, 2000); // need to give solr some time to update so that this query will find any link docs we've added.
                                 }
                             }
                         }
-- 
cgit v1.2.3-70-g09d2

