From 146521beef8ef2ca836a0b4a63a66bdf48485098 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Tue, 9 Jul 2019 14:47:30 -0400 Subject: preparing for merging into master --- src/client/views/collections/CollectionSubView.tsx | 7 ++++--- src/new_fields/Doc.ts | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index a8810f336..873fb518c 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -72,6 +72,7 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T) { if (!proto) { return; } + // The following conditional detects a recurring bug we've seen on the server if (proto[Id] === "collectionProto") { alert("COLLECTION PROTO CURSOR ISSUE DETECTED! Check console for more info..."); console.log(doc); @@ -216,9 +217,9 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T) { body: formData }).then(async (res: Response) => { (await res.json()).map(action((file: any) => { - let path = window.location.origin + file; - let docPromise = Docs.getDocumentFromType(type, path, { ...options, nativeWidth: 300, width: 300, title: dropFileName }); - docPromise.then(doc => doc && this.props.addDocument(doc)); + let full = { ...options, nativeWidth: 300, width: 300, title: dropFileName }; + let path = DocServer.prepend(file); + Docs.getDocumentFromType(type, path, full).then(doc => doc && this.props.addDocument(doc)); })); }); promises.push(prom); diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index d180f8b01..a07f56ca4 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -251,7 +251,6 @@ export namespace Doc { if (allowDuplicates !== true) { let pind = list.reduce((l, d, i) => d instanceof Doc && Doc.AreProtosEqual(d, doc) ? i : l, -1); if (pind !== -1) { - console.log("SPLICING DUPLICATE"); list.splice(pind, 1); } } -- cgit v1.2.3-70-g09d2