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.html | 2 +- .../account/account-settings/account-settings.component.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'client/src/app/account/account-settings') diff --git a/client/src/app/account/account-settings/account-settings.component.html b/client/src/app/account/account-settings/account-settings.component.html index 2f41b5ecf..7ae27dc75 100644 --- a/client/src/app/account/account-settings/account-settings.component.html +++ b/client/src/app/account/account-settings/account-settings.component.html @@ -14,7 +14,7 @@
(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})
- Video quota: {{ userVideoQuotaUsed | bytes: 0 }} / {{ user.videoQuota | bytes: 0 }} + Video quota: {{ userVideoQuotaUsed | bytes: 0 }} / {{ userVideoQuota }}
Account settings
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