Try to fix close issue
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2019-07-19 10:01:39 +02:00
parent e4b21306b1
commit 455562aa90

View File

@ -40,10 +40,15 @@ export class ResumableFileUploadService implements OnDestroy{
updatetotalprogress() {
var totalProgress =0;
var n=0;
for(var i =0;i<this.files.length;i++) {
if(!this.files[i].error) {
totalProgress+=this.files[i].progress;
n++;
}
}
this.totalProgress=totalProgress/this.files.length;
if(totalProgress==100) this.isUploading=false;
}
handleState(state:UploadState) {
@ -57,14 +62,12 @@ export class ResumableFileUploadService implements OnDestroy{
var file =this.files.find((f) => f.identifier == state.uploadId )
if(file) {
file.progress = (state.progress?state.progress:0);
this.updatetotalprogress();
}
};break;
case "complete": {
var file =this.files.find((f) => f.identifier == state.uploadId )
if(file) {
file.progress = (state.progress?state.progress:0);
this.updatetotalprogress();
}
file.success=true;
};break;
@ -76,6 +79,7 @@ export class ResumableFileUploadService implements OnDestroy{
}
};break;
}
this.updatetotalprogress();
this.refresh.next({});
}