diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-11-09 14:13:20 -0500 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-11-09 14:13:20 -0500 |
commit | 517bccdf0921169fd83312f3cedd044522a2398e (patch) | |
tree | d171ec7672230dded66606f8f7e25618b2e70338 /src/client/util/Import & Export/DirectoryImportBox.tsx | |
parent | ca406ddce0a9b35ca9063f74979c952e080339f1 (diff) | |
parent | 5c6dc8fb25c2ac65a9efa534ee86211ac6d68301 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into inking_to_doc
Diffstat (limited to 'src/client/util/Import & Export/DirectoryImportBox.tsx')
-rw-r--r-- | src/client/util/Import & Export/DirectoryImportBox.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx index f27d05487..5904088fc 100644 --- a/src/client/util/Import & Export/DirectoryImportBox.tsx +++ b/src/client/util/Import & Export/DirectoryImportBox.tsx @@ -108,7 +108,8 @@ export default class DirectoryImportBox extends React.Component<FieldViewProps> runInAction(() => this.phase = `Internal: uploading ${this.quota - this.completed} files to Dash...`); - const uploads = await BatchedArray.from(validated, { batchSize: 15 }).batchedMapAsync(async batch => { + const batched = BatchedArray.from(validated, { batchSize: 15 }); + const uploads = await batched.batchedMapAsync<ImageUploadResponse>(async (batch, collector) => { const formData = new FormData(); batch.forEach(file => { @@ -117,9 +118,8 @@ export default class DirectoryImportBox extends React.Component<FieldViewProps> formData.append(Utils.GenerateGuid(), file); }); - const responses = await Identified.PostFormDataToServer(RouteStore.upload, formData); + collector.push(...(await Identified.PostFormDataToServer(RouteStore.upload, formData))); runInAction(() => this.completed += batch.length); - return responses as ImageUploadResponse[]; }); await Promise.all(uploads.map(async upload => { |