Add addedfiles stream
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-08-05 15:49:02 +02:00
parent dfefa6746f
commit ebe435027f

View File

@ -15,6 +15,7 @@ export class ResumableFileUploadService implements OnDestroy{
public isMinimized = false; public isMinimized = false;
public parentCode: string; public parentCode: string;
public refresh: Subject<any> = new Subject<any>(); public refresh: Subject<any> = new Subject<any>();
public addedFiles: Subject<File> = new Subject<File>();
private _eventSub:Subscription; private _eventSub:Subscription;
private initialized = false; private initialized = false;
@ -54,8 +55,10 @@ export class ResumableFileUploadService implements OnDestroy{
handleState(state:UploadState) { handleState(state:UploadState) {
var file =this.files.find((f) => f.identifier == state.uploadId ) var file =this.files.find((f) => f.identifier == state.uploadId )
if(state.status != "cancelled" && !file) { if(state.status != "cancelled" && !file) {
this.files.push(new File(state)); let file = new File(state);
this.files.push(file);
this.isClosed=false; this.isClosed=false;
this.addedFiles.next(file)
} }
switch(state.status) { switch(state.status) {
case "uploading": { case "uploading": {