185. Report upload progress - Part 3 (#26)

This commit is contained in:
Art
2021-09-22 15:27:29 +03:00
parent 1cc28049b5
commit c45153fb45
2 changed files with 7 additions and 3 deletions

View File

@ -137,10 +137,10 @@
<img class="rounded" height="135" width="135" src="{{loggedInUser?.profileImageUrl}}"
alt="">
</div>
<div *ngIf="true" class="progress mt-1">
<div *ngIf="fileUploadStatus?.status==='progress'" class="progress mt-1">
<div class="progress-bar bg-info" role="progressbar"
[style.width.%]="50" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100">50%
[style.width.%]="fileUploadStatus?.percentage" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100">{{fileUploadStatus?.percentage}}%
</div>
</div>
</div>

View File

@ -250,6 +250,7 @@ export class UserComponent implements OnInit, OnDestroy {
(errorResponse: HttpErrorResponse) => {
this.sendErrorNotification(errorResponse.error.message);
this.refreshing = false;
this.fileUploadStatus.status = 'error';
},
() => {
this.refreshing = false;
@ -276,6 +277,9 @@ export class UserComponent implements OnInit, OnDestroy {
this.sendErrorNotification('Unable to upload image. Please try again');
}
break;
default:
this.fileUploadStatus.status='default';
}
}
}