diff --git a/projects/common/src/fm/components/resumable-file-upload/resumable-file-upload.service.ts b/projects/common/src/fm/components/resumable-file-upload/resumable-file-upload.service.ts index ba45c7a..30f3d3d 100644 --- a/projects/common/src/fm/components/resumable-file-upload/resumable-file-upload.service.ts +++ b/projects/common/src/fm/components/resumable-file-upload/resumable-file-upload.service.ts @@ -52,23 +52,19 @@ export class ResumableFileUploadService implements OnDestroy{ } handleState(state:UploadState) { + var file =this.files.find((f) => f.identifier == state.uploadId ) + if(!file) { + this.files.push(new File(state)); + this.isClosed=false; + } switch(state.status) { - case "queue": { - var file =this.files.find((f) => f.identifier == state.uploadId ) - if(!file) { - this.files.push(new File(state)); - this.isClosed=false; - } - };break; case "uploading": { this.isUploading = true; - var file =this.files.find((f) => f.identifier == state.uploadId ) if(file) { file.progress = (state.progress?state.progress:0); } };break; case "complete": { - var file =this.files.find((f) => f.identifier == state.uploadId ) if(file) { var parts = state.url.split("/"); file.itemCode = parts[parts.length-1]; @@ -77,7 +73,6 @@ export class ResumableFileUploadService implements OnDestroy{ } };break; case "error": { - var file =this.files.find((f) => f.identifier == state.uploadId ) if(file) { file.error=true; file.errorMessage = state.response as string;