mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-17 22:42:22 +08:00
Fix unexpected error on step attachments [SCI-7032]
This commit is contained in:
parent
39fbb2a9a0
commit
1a13e1bfc6
2 changed files with 10 additions and 1 deletions
|
|
@ -432,7 +432,7 @@
|
|||
.error-container {
|
||||
color: $brand-danger;
|
||||
margin-top: 1em;
|
||||
padding: 0 2em;
|
||||
padding: 0 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,10 +55,15 @@ export default {
|
|||
|
||||
fileObject.isNewUpload = true;
|
||||
this.attachments.push(fileObject);
|
||||
const filePosition = this.attachments.length - 1;
|
||||
|
||||
upload.create((error, blob) => {
|
||||
if (error) {
|
||||
fileObject.error = I18n.t('protocols.steps.attachments.new.general_error');
|
||||
this.attachments.splice(filePosition, 1);
|
||||
setTimeout(() => {
|
||||
this.attachments.push(fileObject);
|
||||
}, 0);
|
||||
reject(error);
|
||||
} else {
|
||||
const signedId = blob.signed_id;
|
||||
|
|
@ -69,6 +74,10 @@ export default {
|
|||
fileObject.attributes = result.data.attributes;
|
||||
}).error(() => {
|
||||
fileObject.error = I18n.t('protocols.steps.attachments.new.general_error');
|
||||
this.attachments.splice(filePosition, 1);
|
||||
setTimeout(() => {
|
||||
this.attachments.push(fileObject);
|
||||
}, 0);
|
||||
});
|
||||
filesUploadedCntr += 1;
|
||||
if (filesUploadedCntr === filesToUploadCntr) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue