Try to fix close issue
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
e4b21306b1
commit
455562aa90
@ -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({});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user