Skip to content

Commit eac29ad

Browse files
author
翰文
committed
fix: add catch after beforeUpload
close react-component#64
1 parent 993aca2 commit eac29ad

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# History
22
----
33

4+
### 2.3.3 / 2017-02-20
5+
6+
- beforeUpload add empty catch function when promise passed, fix [#64](https://github.com/react-component/upload/issues/64)
7+
48
### 2.3.2 / 2016-12-30
59

610
- Fix crash if customRequest does not call onSuccess() / onError() [!60](https://github.com/react-component/upload/pull/60)

examples/beforeUpload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const props = {
1818
},
1919
beforeUpload(file, fileList) {
2020
console.log(file, fileList);
21-
return new Promise((resolve) => {
21+
return new Promise((resolve, reject) => {
2222
console.log('start check');
2323
setTimeout(() => {
2424
console.log('check finshed');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-upload",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "upload ui component for react",
55
"keywords": [
66
"react",

src/AjaxUploader.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ const AjaxUploader = React.createClass({
9595
} else {
9696
this.post(file);
9797
}
98+
}).catch(e => {
99+
console && console.log(e);
98100
});
99101
} else if (before !== false) {
100102
setTimeout(() => this.post(file), 0);

0 commit comments

Comments
 (0)