From 234b535dacdeacfacd7ac5601e53b6b7d923ca00 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Jan 2018 16:30:39 +0100 Subject: Update dependencies --- .../account/account-settings/account-settings.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'client/src/app/account/account-settings/account-settings.component.ts') diff --git a/client/src/app/account/account-settings/account-settings.component.ts b/client/src/app/account/account-settings/account-settings.component.ts index a375072a0..524607817 100644 --- a/client/src/app/account/account-settings/account-settings.component.ts +++ b/client/src/app/account/account-settings/account-settings.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core' import { NotificationsService } from 'angular2-notifications' +import { BytesPipe } from 'ngx-pipes' import { AuthService } from '../../core' import { ServerService } from '../../core/server' import { User } from '../../shared' @@ -14,6 +15,7 @@ export class AccountSettingsComponent implements OnInit { @ViewChild('avatarfileInput') avatarfileInput user: User = null + userVideoQuota = '0' userVideoQuotaUsed = 0 constructor ( @@ -26,6 +28,16 @@ export class AccountSettingsComponent implements OnInit { ngOnInit () { this.user = this.authService.getUser() + this.authService.userInformationLoaded.subscribe( + () => { + if (this.user.videoQuota !== -1) { + this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() + } else { + this.userVideoQuota = 'Unlimited' + } + } + ) + this.userService.getMyVideoQuotaUsed() .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed) } -- cgit v1.2.3