Try to fix close issue
FarmMaps.Develop/FarmMapsLib/develop This commit looks good Details

pull/1/head
Willem Dantuma 2019-07-19 10:01:39 +02:00
parent e4b21306b1
commit 455562aa90
1 changed files with 7 additions and 3 deletions

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++) {
totalProgress+=this.files[i].progress;
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({});
}