1
0
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:
llj
2021-12-04 15:52:05 +08:00
parent 3ff507ad70
commit 4588d4dc88

View File

@@ -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