mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +00:00
show detailed error msg when download folder
This commit is contained in:
@@ -61,13 +61,21 @@ class ZipDownloadDialog extends React.Component {
|
||||
const zipToken = this.state.zipToken;
|
||||
seafileAPI.queryZipProgress(zipToken).then((res) => {
|
||||
const data = res.data;
|
||||
this.setState({
|
||||
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
||||
});
|
||||
if (data['total'] == data['zipped']) {
|
||||
if (data.failed == 1) {
|
||||
clearInterval(interval);
|
||||
this.props.toggleDialog();
|
||||
location.href = `${fileServerRoot}zip/${zipToken}`;
|
||||
this.setState({
|
||||
isLoading: false,
|
||||
errorMsg: data.failed_reason
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
||||
});
|
||||
if (data['total'] == data['zipped']) {
|
||||
clearInterval(interval);
|
||||
this.props.toggleDialog();
|
||||
location.href = `${fileServerRoot}zip/${zipToken}`;
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
clearInterval(interval);
|
||||
|
Reference in New Issue
Block a user