From ae8bc0f99f35f6c72aaa9be3f5617d54ba64299b Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Tue, 12 Mar 2019 11:03:19 -0400
Subject: Fixes

---
 src/client/views/collections/CollectionViewBase.tsx | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

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

diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index a77133e6c..b581d3060 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -82,21 +82,7 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
             const upload = window.location.origin + "/upload";
             let item = e.dataTransfer.items[i];
             if (item.kind === "string" && item.type.indexOf("uri") != -1) {
-                e.dataTransfer.items[i].getAsString(function (s) {
-                    action(() => {
-                        var img = Documents.ImageDocument(s, { ...options, nativeWidth: 300, width: 300, })
-
-                        let docs = that.props.Document.GetT(KeyStore.Data, ListField);
-                        if (docs != FieldWaiting) {
-                            if (!docs) {
-                                docs = new ListField<Document>();
-                                that.props.Document.Set(KeyStore.Data, docs)
-                            }
-                            docs.Data.push(img);
-                        }
-                    })()
-
-                })
+                e.dataTransfer.items[i].getAsString(action((s: string) => this.props.addDocument(Documents.WebDocument(s, options))))
             }
             let type = item.type
             console.log(type)
-- 
cgit v1.2.3-70-g09d2

