1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +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 = () => { uploadFile = () => {
let resumableFile = this.resumable.files[this.resumable.files.length - 1]; let resumableFile = this.resumable.files[this.resumable.files.length - 1];
this.setState({ let { repoID, path } = this.props;
isUploadRemindDialogShow: false, seafileAPI.getUploadLink(repoID, path).then((res) => { // get upload link
isUploadProgressDialogShow: true, this.resumable.opts.target = res.data + '?ret-json=1';
uploadFileList: [...this.state.uploadFileList, resumableFile] this.setState({
}, () => { isUploadRemindDialogShow: false,
this.resumable.upload(); 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 = () => { cancelFileUpload = () => {