aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Import & Export/DirectoryImportBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/Import & Export/DirectoryImportBox.tsx')
-rw-r--r--src/client/util/Import & Export/DirectoryImportBox.tsx29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx
index 26a00dc7c..8948b73f7 100644
--- a/src/client/util/Import & Export/DirectoryImportBox.tsx
+++ b/src/client/util/Import & Export/DirectoryImportBox.tsx
@@ -104,22 +104,19 @@ 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).batchedMapAsync({
- batcher: { batchSize: 15 },
- converter: async batch => {
- const formData = new FormData();
- const parameters = { method: 'POST', body: formData };
-
- batch.forEach(file => {
- sizes.push(file.size);
- modifiedDates.push(file.lastModified);
- formData.append(Utils.GenerateGuid(), file);
- });
-
- const responses = await (await fetch(RouteStore.upload, parameters)).json();
- runInAction(() => this.completed += batch.length);
- return responses as FileResponse[];
- }
+ const uploads = await BatchedArray.from(validated, { batchSize: 15 }).batchedMapAsync(async batch => {
+ const formData = new FormData();
+ const parameters = { method: 'POST', body: formData };
+
+ batch.forEach(file => {
+ sizes.push(file.size);
+ modifiedDates.push(file.lastModified);
+ formData.append(Utils.GenerateGuid(), file);
+ });
+
+ const responses = await (await fetch(RouteStore.upload, parameters)).json();
+ runInAction(() => this.completed += batch.length);
+ return responses as FileResponse[];
});
await Promise.all(uploads.map(async upload => {