mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 04:48:03 +00:00
[upload link] only show the error msg for the first failed file
This commit is contained in:
@@ -425,7 +425,9 @@ class FileUploader extends React.Component {
|
||||
const message = gettext('All files uploaded');
|
||||
toaster.success(message);
|
||||
}
|
||||
this.error = false; // reset it
|
||||
// reset it
|
||||
this.error = false;
|
||||
this.hasShownErrorMsg = false;
|
||||
|
||||
this.notifiedFolders = [];
|
||||
// reset upload link loaded
|
||||
@@ -439,7 +441,12 @@ class FileUploader extends React.Component {
|
||||
msg = gettext('Failed to upload {file_name}.')
|
||||
.replace('{file_name}', file.fileName);
|
||||
}
|
||||
toaster.danger(msg);
|
||||
|
||||
// only show the error msg for once
|
||||
if (!this.hasShownErrorMsg) {
|
||||
toaster.danger(msg);
|
||||
this.hasShownErrorMsg = true;
|
||||
}
|
||||
this.error = true;
|
||||
|
||||
// reset upload link loaded
|
||||
|
Reference in New Issue
Block a user