From bd46e2c0ee4260b341af5dba2efba7511c4ea829 Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Sun, 16 Feb 2020 00:56:56 -0500
Subject: clean up

---
 src/client/views/collections/CollectionSubView.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index e0b2d524b..e80e1c802 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -314,7 +314,7 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
                         file && file.type && files.push(file);
                     }
                 }
-                (await Networking.UploadFilesToServer(files)).forEach(({ source: { name, type }, result }) => {
+                promises.push(Networking.UploadFilesToServer(files).then(responses => responses.forEach(({ source: { name, type }, result }) => {
                     if (result instanceof Error) {
                         alert(`Upload failed: ${result.message}`);
                         return;
@@ -333,7 +333,7 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
                             this.props?.addDocument(doc);
                         }
                     });
-                });
+                })));
                 if (promises.length) {
                     Promise.all(promises).finally(() => { completed && completed(); batch.end(); });
                 } else {
-- 
cgit v1.2.3-70-g09d2

