Skip to content

Commit 29020dc

Browse files
author
PatrickSachs
committed
Fixed #51
1 parent db4920b commit 29020dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/fields/FileField.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ export default class FileField extends React.Component {
3838
});
3939
}
4040

41-
onChange(e) {
41+
async onChange(e) {
4242
if (e.currentTarget.files.length === 0) {
4343
return;
4444
}
4545
const { multiple, onChange } = this.props;
4646
const nativeArray = [...e.currentTarget.files]
4747
if (multiple) {
48-
onChange(Promise.all(nativeArray.map(this.uploadFile)))
48+
onChange(await Promise.all(nativeArray.map(this.uploadFile)))
4949
} else if (nativeArray.length) {
50-
onChange(this.uploadFile(nativeArray[0]));
50+
onChange(await this.uploadFile(nativeArray[0]));
5151
} else {
5252
onChange({ name: "", size: 0, type: "", data: "" });
5353
}

0 commit comments

Comments
 (0)