185. Report upload progress - Part 3 (#26)
This commit is contained in:
@ -137,10 +137,10 @@
|
|||||||
<img class="rounded" height="135" width="135" src="{{loggedInUser?.profileImageUrl}}"
|
<img class="rounded" height="135" width="135" src="{{loggedInUser?.profileImageUrl}}"
|
||||||
alt="">
|
alt="">
|
||||||
</div>
|
</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"
|
<div class="progress-bar bg-info" role="progressbar"
|
||||||
[style.width.%]="50" aria-valuenow="0" aria-valuemin="0"
|
[style.width.%]="fileUploadStatus?.percentage" aria-valuenow="0" aria-valuemin="0"
|
||||||
aria-valuemax="100">50%
|
aria-valuemax="100">{{fileUploadStatus?.percentage}}%
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -250,6 +250,7 @@ export class UserComponent implements OnInit, OnDestroy {
|
|||||||
(errorResponse: HttpErrorResponse) => {
|
(errorResponse: HttpErrorResponse) => {
|
||||||
this.sendErrorNotification(errorResponse.error.message);
|
this.sendErrorNotification(errorResponse.error.message);
|
||||||
this.refreshing = false;
|
this.refreshing = false;
|
||||||
|
this.fileUploadStatus.status = 'error';
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.refreshing = false;
|
this.refreshing = false;
|
||||||
@ -276,6 +277,9 @@ export class UserComponent implements OnInit, OnDestroy {
|
|||||||
this.sendErrorNotification('Unable to upload image. Please try again');
|
this.sendErrorNotification('Unable to upload image. Please try again');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
this.fileUploadStatus.status='default';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user