1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

repair upload bug

This commit is contained in:
shanshuirenjia
2019-06-04 11:49:41 +08:00
parent ffe2acf5e6
commit 7756093299
2 changed files with 4 additions and 3 deletions

View File

@@ -8,7 +8,8 @@ if (typeof Promise === 'undefined') {
window.Promise = require('promise/lib/es6-extensions.js'); window.Promise = require('promise/lib/es6-extensions.js');
} }
require('babel-polyfill'); // require('babel-polyfill');
require('react-app-polyfill/stable');
// fetch() polyfill for making API calls. // fetch() polyfill for making API calls.
require('whatwg-fetch'); require('whatwg-fetch');

View File

@@ -414,19 +414,19 @@ class FileUploader extends React.Component {
onFileUpload = () => { onFileUpload = () => {
this.uploadInput.current.removeAttribute('webkitdirectory'); this.uploadInput.current.removeAttribute('webkitdirectory');
this.uploadInput.current.click();
let repoID = this.props.repoID; let repoID = this.props.repoID;
seafileAPI.getUploadLink(repoID, this.props.path).then(res => { seafileAPI.getUploadLink(repoID, this.props.path).then(res => {
this.resumable.opts.target = res.data; this.resumable.opts.target = res.data;
this.uploadInput.current.click();
}); });
} }
onFolderUpload = () => { onFolderUpload = () => {
this.uploadInput.current.setAttribute('webkitdirectory', 'webkitdirectory'); this.uploadInput.current.setAttribute('webkitdirectory', 'webkitdirectory');
this.uploadInput.current.click();
let repoID = this.props.repoID; let repoID = this.props.repoID;
seafileAPI.getUploadLink(repoID, this.props.path).then(res => { seafileAPI.getUploadLink(repoID, this.props.path).then(res => {
this.resumable.opts.target = res.data; this.resumable.opts.target = res.data;
this.uploadInput.current.click();
}); });
} }