aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/users
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/users')
-rw-r--r--client/src/app/core/users/user.service.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/client/src/app/core/users/user.service.ts b/client/src/app/core/users/user.service.ts
index 01c9be5bf..2f3945169 100644
--- a/client/src/app/core/users/user.service.ts
+++ b/client/src/app/core/users/user.service.ts
@@ -4,7 +4,7 @@ import { catchError, concatMap, filter, first, map, shareReplay, throttleTime, t
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { AuthService } from '@app/core/auth' 6import { AuthService } from '@app/core/auth'
7import { BytesPipe } from '@app/shared/shared-main' 7import { getBytes } from '@root-helpers/bytes'
8import { UserLocalStorageKeys } from '@root-helpers/users' 8import { UserLocalStorageKeys } from '@root-helpers/users'
9import { 9import {
10 Avatar, 10 Avatar,
@@ -27,8 +27,6 @@ import { User } from './user.model'
27export class UserService { 27export class UserService {
28 static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/' 28 static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/'
29 29
30 private bytesPipe = new BytesPipe()
31
32 private userCache: { [ id: number ]: Observable<UserServerModel> } = {} 30 private userCache: { [ id: number ]: Observable<UserServerModel> } = {}
33 31
34 constructor ( 32 constructor (
@@ -365,19 +363,19 @@ export class UserService {
365 if (user.videoQuota === -1) { 363 if (user.videoQuota === -1) {
366 videoQuota = '∞' 364 videoQuota = '∞'
367 } else { 365 } else {
368 videoQuota = this.bytesPipe.transform(user.videoQuota, 0) 366 videoQuota = getBytes(user.videoQuota, 0)
369 } 367 }
370 368
371 const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) 369 const videoQuotaUsed = getBytes(user.videoQuotaUsed, 0)
372 370
373 let videoQuotaDaily: string 371 let videoQuotaDaily: string
374 let videoQuotaUsedDaily: string 372 let videoQuotaUsedDaily: string
375 if (user.videoQuotaDaily === -1) { 373 if (user.videoQuotaDaily === -1) {
376 videoQuotaDaily = '∞' 374 videoQuotaDaily = '∞'
377 videoQuotaUsedDaily = this.bytesPipe.transform(0, 0) + '' 375 videoQuotaUsedDaily = getBytes(0, 0) + ''
378 } else { 376 } else {
379 videoQuotaDaily = this.bytesPipe.transform(user.videoQuotaDaily, 0) + '' 377 videoQuotaDaily = getBytes(user.videoQuotaDaily, 0) + ''
380 videoQuotaUsedDaily = this.bytesPipe.transform(user.videoQuotaUsedDaily || 0, 0) + '' 378 videoQuotaUsedDaily = getBytes(user.videoQuotaUsedDaily || 0, 0) + ''
381 } 379 }
382 380
383 const roleLabels: { [ id in UserRole ]: string } = { 381 const roleLabels: { [ id in UserRole ]: string } = {