From 287124d110391959462b60b45ebbfe90db3a1e40 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 28 Jun 2020 01:17:48 +0200 Subject: fix quota representation in profile settings --- .../my-account-settings/my-account-settings.component.html | 4 ++-- .../+my-account/my-account-settings/my-account-settings.component.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html index 2826d8d83..26096da02 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html @@ -10,14 +10,14 @@
-
{{ userVideoQuotaUsed | bytes: 0 }}
+
{{ userVideoQuotaUsed | bytes: 0 }}
{{ userVideoQuota }}
-
{{ userVideoQuotaUsedDaily | bytes: 0 }}
+
{{ userVideoQuotaUsedDaily | bytes: 0 }}
{{ userVideoQuotaDaily }}
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index 4800be24b..a9a150e21 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts @@ -41,14 +41,12 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { () => { if (this.user.videoQuota !== -1) { this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() - this.userVideoQuotaPercentage = this.user.videoQuota * 100 / this.userVideoQuotaUsed } else { this.userVideoQuota = this.i18n('Unlimited') } if (this.user.videoQuotaDaily !== -1) { this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() - this.userVideoQuotaDailyPercentage = this.user.videoQuotaDaily * 100 / this.userVideoQuotaUsedDaily } else { this.userVideoQuotaDaily = this.i18n('Unlimited') } @@ -58,7 +56,10 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { this.userService.getMyVideoQuotaUsed() .subscribe(data => { this.userVideoQuotaUsed = data.videoQuotaUsed + this.userVideoQuotaPercentage = this.userVideoQuotaUsed * 100 / this.user.videoQuota + this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily + this.userVideoQuotaDailyPercentage = this.userVideoQuotaUsedDaily * 100 / this.user.videoQuotaDaily }) } -- cgit v1.2.3