mirror of
https://github.com/haiwen/seahub.git
synced 2025-04-27 11:01:14 +00:00
[dir view] fixed 'upload & replace a file'(so that the related upload data can be displayed in the popover)
This commit is contained in:
parent
7a7079ed48
commit
84e763cddf
@ -630,16 +630,21 @@ class FileUploader extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
replaceRepetitionFile = () => {
|
replaceRepetitionFile = () => {
|
||||||
|
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
||||||
let { repoID, path } = this.props;
|
let { repoID, path } = this.props;
|
||||||
seafileAPI.getUpdateLink(repoID, path).then(res => {
|
seafileAPI.getUpdateLink(repoID, path).then(res => {
|
||||||
this.resumable.opts.target = res.data;
|
this.resumable.opts.target = res.data;
|
||||||
|
|
||||||
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
|
||||||
resumableFile.formData['replace'] = 1;
|
resumableFile.formData['replace'] = 1;
|
||||||
resumableFile.formData['target_file'] = resumableFile.formData.parent_dir + resumableFile.fileName;
|
resumableFile.formData['target_file'] = resumableFile.formData.parent_dir + resumableFile.fileName;
|
||||||
this.setState({ isUploadRemindDialogShow: false });
|
this.setState({
|
||||||
this.setUploadFileList(this.resumable.files);
|
isUploadRemindDialogShow: false,
|
||||||
this.resumable.upload();
|
isUploadProgressDialogShow: true,
|
||||||
|
uploadFileList: [...this.state.uploadFileList, resumableFile]
|
||||||
|
}, () => {
|
||||||
|
this.resumable.upload();
|
||||||
|
});
|
||||||
|
Utils.registerGlobalVariable('uploader', 'isUploadProgressDialogShow', true);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
|
Loading…
Reference in New Issue
Block a user