1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

repair reupload bug (#4241)

* repair reupload bug

* repair code bug
This commit is contained in:
杨顺强
2019-11-09 16:26:25 +08:00
committed by Daniel Pan
parent a381f9c79d
commit af78fab2df

View File

@@ -624,14 +624,22 @@ class FileUploader extends React.Component {
uploadFile = () => {
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
this.setState({
isUploadRemindDialogShow: false,
isUploadProgressDialogShow: true,
uploadFileList: [...this.state.uploadFileList, resumableFile]
}, () => {
this.resumable.upload();
let { repoID, path } = this.props;
seafileAPI.getUploadLink(repoID, path).then((res) => { // get upload link
this.resumable.opts.target = res.data + '?ret-json=1';
this.setState({
isUploadRemindDialogShow: false,
isUploadProgressDialogShow: true,
uploadFileList: [...this.state.uploadFileList, resumableFile]
}, () => {
this.resumable.upload();
});
Utils.registerGlobalVariable('uploader', 'isUploadProgressDialogShow', true);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
Utils.registerGlobalVariable('uploader', 'isUploadProgressDialogShow', true);
}
cancelFileUpload = () => {