mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
Download tips (#3242)
* Download out of limit prompt * Canonical format * Remove gettext * delete wrap
This commit is contained in:
@@ -14,6 +14,7 @@ import MoveDirentDialog from '../dialog/move-dirent-dialog';
|
||||
import CopyDirentDialog from '../dialog/copy-dirent-dialog';
|
||||
import ShareDialog from '../dialog/share-dialog';
|
||||
import DirentRightMenu from './dirent-right-menu';
|
||||
import toaster from '../toast';
|
||||
|
||||
import '../../css/dirent-list-item.css';
|
||||
|
||||
@@ -345,8 +346,11 @@ class DirentListItem extends React.Component {
|
||||
this.zipToken = res.data['zip_token'];
|
||||
this.addDownloadAnimation();
|
||||
this.interval = setInterval(this.addDownloadAnimation, 1000);
|
||||
}).catch(() => {
|
||||
}).catch((error) => {
|
||||
clearInterval(this.interval);
|
||||
this.setState({isProgressDialogShow: false});
|
||||
let errorMessage = error.response.data.error_msg;
|
||||
toaster.danger(errorMessage);
|
||||
});
|
||||
} else {
|
||||
let url = URLDecorator.getUrl({type: 'download_file_url', repoID: repoID, filePath: direntPath});
|
||||
@@ -378,6 +382,7 @@ class DirentListItem extends React.Component {
|
||||
onCancelDownload = () => {
|
||||
let zipToken = this.zipToken;
|
||||
seafileAPI.cancelZipTask(zipToken).then(res => {
|
||||
clearInterval(this.interval);
|
||||
this.setState({
|
||||
isProgressDialogShow: false,
|
||||
});
|
||||
|
@@ -82,6 +82,11 @@ class MutipleDirOperationToolbar extends React.Component {
|
||||
this.zipToken = res.data['zip_token'];
|
||||
this.addDownloadAnimation();
|
||||
this.interval = setInterval(this.addDownloadAnimation, 1000);
|
||||
}).catch((error) => {
|
||||
clearInterval(this.interval);
|
||||
this.setState({isProgressDialogShow: false});
|
||||
let errorMessage = error.response.data.error_msg;
|
||||
toaster.danger(errorMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -110,6 +115,7 @@ class MutipleDirOperationToolbar extends React.Component {
|
||||
|
||||
onCancelDownload = () => {
|
||||
seafileAPI.cancelZipTask(this.zipToken).then(() => {
|
||||
clearInterval(this.interval);
|
||||
this.setState({isProgressDialogShow: false});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user