})
export class MyAccountSettingsComponent implements OnInit {
user: User = null
+
userVideoQuota = '0'
userVideoQuotaUsed = 0
+ userVideoQuotaDaily = '0'
+ userVideoQuotaUsedDaily = 0
+
constructor (
private userService: UserService,
private authService: AuthService,
} else {
this.userVideoQuota = this.i18n('Unlimited')
}
+
+ if (this.user.videoQuotaDaily !== -1) {
+ this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString()
+ } else {
+ this.userVideoQuotaDaily = this.i18n('Unlimited')
+ }
}
)
this.userService.getMyVideoQuotaUsed()
- .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed)
+ .subscribe(data => {
+ this.userVideoQuotaUsed = data.videoQuotaUsed
+ this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily
+ })
}
onAvatarChange (formData: FormData) {
err => this.notifier.error(err.message)
)
}
+
+ hasDailyQuota () {
+ return this.user.videoQuotaDaily !== -1
+ }
}