aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-04 13:19:55 +0100
committerChocobozzz <me@florianbigard.com>2019-12-04 13:20:02 +0100
commit66fd15160e633d98fd7933ffe4abb6c55fcd1755 (patch)
tree43215742a9404a39039b18cca7debdac3a933a71 /client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
parentc883db6d038a8510205f5f13ef46fb5a1c9e8288 (diff)
downloadPeerTube-66fd15160e633d98fd7933ffe4abb6c55fcd1755.tar.gz
PeerTube-66fd15160e633d98fd7933ffe4abb6c55fcd1755.tar.zst
PeerTube-66fd15160e633d98fd7933ffe4abb6c55fcd1755.zip
Clearer video quota label in user settings
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-settings.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts19
1 files changed, 18 insertions, 1 deletions
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 95fd2a3db..e314cdbea 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
@@ -13,9 +13,13 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
13}) 13})
14export class MyAccountSettingsComponent implements OnInit { 14export class MyAccountSettingsComponent implements OnInit {
15 user: User = null 15 user: User = null
16
16 userVideoQuota = '0' 17 userVideoQuota = '0'
17 userVideoQuotaUsed = 0 18 userVideoQuotaUsed = 0
18 19
20 userVideoQuotaDaily = '0'
21 userVideoQuotaUsedDaily = 0
22
19 constructor ( 23 constructor (
20 private userService: UserService, 24 private userService: UserService,
21 private authService: AuthService, 25 private authService: AuthService,
@@ -37,11 +41,20 @@ export class MyAccountSettingsComponent implements OnInit {
37 } else { 41 } else {
38 this.userVideoQuota = this.i18n('Unlimited') 42 this.userVideoQuota = this.i18n('Unlimited')
39 } 43 }
44
45 if (this.user.videoQuotaDaily !== -1) {
46 this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString()
47 } else {
48 this.userVideoQuotaDaily = this.i18n('Unlimited')
49 }
40 } 50 }
41 ) 51 )
42 52
43 this.userService.getMyVideoQuotaUsed() 53 this.userService.getMyVideoQuotaUsed()
44 .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed) 54 .subscribe(data => {
55 this.userVideoQuotaUsed = data.videoQuotaUsed
56 this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily
57 })
45 } 58 }
46 59
47 onAvatarChange (formData: FormData) { 60 onAvatarChange (formData: FormData) {
@@ -56,4 +69,8 @@ export class MyAccountSettingsComponent implements OnInit {
56 err => this.notifier.error(err.message) 69 err => this.notifier.error(err.message)
57 ) 70 )
58 } 71 }
72
73 hasDailyQuota () {
74 return this.user.videoQuotaDaily !== -1
75 }
59} 76}