Fix loc error with cancelling in progress uploads
Этот коммит содержится в:
@@ -285,7 +285,7 @@ class CreateComment extends React.Component {
|
|||||||
|
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
uploadsInProgress.splice(index, 1);
|
uploadsInProgress.splice(index, 1);
|
||||||
this.refs.fileUpload.cancelUpload(id);
|
this.refs.fileUpload.getWrappedInstance().cancelUpload(id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
previews.splice(index, 1);
|
previews.splice(index, 1);
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ class CreatePost extends React.Component {
|
|||||||
|
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
uploadsInProgress.splice(index, 1);
|
uploadsInProgress.splice(index, 1);
|
||||||
this.refs.fileUpload.cancelUpload(id);
|
this.refs.fileUpload.getWrappedInstance().cancelUpload(id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
previews.splice(index, 1);
|
previews.splice(index, 1);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class FileUpload extends React.Component {
|
|||||||
this.uploadFiles = this.uploadFiles.bind(this);
|
this.uploadFiles = this.uploadFiles.bind(this);
|
||||||
this.handleChange = this.handleChange.bind(this);
|
this.handleChange = this.handleChange.bind(this);
|
||||||
this.handleDrop = this.handleDrop.bind(this);
|
this.handleDrop = this.handleDrop.bind(this);
|
||||||
|
this.cancelUpload = this.cancelUpload.bind(this);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
requests: {}
|
requests: {}
|
||||||
@@ -331,4 +332,4 @@ FileUpload.propTypes = {
|
|||||||
postType: React.PropTypes.string
|
postType: React.PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
export default injectIntl(FileUpload);
|
export default injectIntl(FileUpload, {withRef: true});
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user