SUPPORT-8381: fix (2)

This commit is contained in:
Alexandr Shalaginov 2024-07-29 11:51:29 +03:00
parent 0558ac58e0
commit 82e8b11262

View file

@ -54,6 +54,7 @@ export class ErvuFileUpload extends InputControl {
private fileInputEl: HTMLInputElement;
private url: string = '/backend/employee/document';
private messagesService: MessagesService;
private isUploadErrorOccurred = false;
constructor(el: ElementRef, cd: ChangeDetectorRef) {
super(el, cd);
@ -135,14 +136,17 @@ export class ErvuFileUpload extends InputControl {
this.isDropZoneVisible = true;
this.isFilesListVisible = true;
this.isProgressBarVisible = false;
this.isUploadErrorOccurred = true;
this.cd.markForCheck();
};
this.uploader.onCompleteAll = () => {
this.uploader.clearQueue();
this.fileUploadEndEvent.trigger();
this.isProgressBarVisible = false;
this.cd.markForCheck();
if (!this.isUploadErrorOccurred) {
this.uploader.clearQueue();
this.fileUploadEndEvent.trigger();
this.isProgressBarVisible = false;
this.cd.markForCheck();
}
};
this.uploader.onAfterAddingFile = (fileItem: FileItem) => {
@ -220,6 +224,7 @@ export class ErvuFileUpload extends InputControl {
this.isDropZoneVisible = true;
this.isFilesListVisible = true;
this.isProgressBarVisible = false;
this.isUploadErrorOccurred = false;
this.cd.markForCheck();
}
}