Modified progrss bar handler

This commit is contained in:
Rajnikant 2022-06-08 18:51:08 +05:30
parent 78f77dc881
commit 726562d615

View File

@ -75,6 +75,7 @@ export class AddImageDialogComponent implements OnInit, DoCheck {
.pipe(catchError((error) => of(error)));
this.forkObservable.push(object);
});
this.uploadProgress = this.forkObservable.length;
this.cancelRequsts = forkJoin(this.forkObservable).subscribe((responses) => {
this.uploadFileMessage = responses;
@ -86,11 +87,11 @@ export class AddImageDialogComponent implements OnInit, DoCheck {
ngDoCheck() {
setTimeout(() => {
if (this.uploadProgress < 95) {
if (this.uploadProgress < 100 - this.forkObservable.length) {
this.uploadProgress = this.uploadProgress + 1;
this.uploadServiceService.processBarCount(this.uploadProgress);
}
}, 10000);
}, this.forkObservable.length * 10000);
}
cancelUploading() {
this.cancelRequsts.unsubscribe();