Skip to content

Commit 959c3f5

Browse files
Merge pull request #1648 from Tanddant/Fix-#1644
[ListItemAttachments] - Upload files in sequence not parallel
2 parents b07aa00 + c66bbc7 commit 959c3f5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/controls/listItemAttachments/ListItemAttachments.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ export class ListItemAttachments extends React.Component<IListItemAttachmentsPro
7676

7777
public async uploadAttachments(itemId: number): Promise<void> {
7878
if (this.state.filesToUpload) {
79-
await Promise.all(this.state.filesToUpload.map(file => this._spservice.addAttachment(
80-
this.props.listId,
81-
itemId,
82-
file.name,
83-
file,
84-
this.props.webUrl)));
79+
for (const file of this.state.filesToUpload) {
80+
await this._spservice.addAttachment(
81+
this.props.listId,
82+
itemId,
83+
file.name,
84+
file,
85+
this.props.webUrl);
86+
}
8587
}
8688
return new Promise<void>((resolve, reject) => {
8789
this.setState({

0 commit comments

Comments
 (0)