]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/overview/overview.service.ts
Set a default background color for account avatar
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / overview / overview.service.ts
index 4a4714af62eb23ba4618c3afce3445e7d8b50b99..79cb781f7c30d2f07b50134d9e3346d96d19b8f9 100644 (file)
@@ -5,7 +5,6 @@ import { forkJoin, Observable, of } from 'rxjs'
 import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models'
 import { environment } from '../../../environments/environment'
 import { RestExtractor } from '../rest/rest-extractor.service'
-import { RestService } from '../rest/rest.service'
 import { VideosOverview } from '@app/shared/overview/videos-overview.model'
 import { VideoService } from '@app/shared/video/video.service'
 import { ServerService } from '@app/core'
@@ -18,7 +17,6 @@ export class OverviewService {
   constructor (
     private authHttp: HttpClient,
     private restExtractor: RestExtractor,
-    private restService: RestService,
     private videosService: VideoService,
     private serverService: ServerService
   ) {}
@@ -47,7 +45,7 @@ export class OverviewService {
           of(object.videos)
             .pipe(
               switchMap(videos => this.videosService.extractVideos({ total: 0, data: videos })),
-              map(result => result.videos),
+              map(result => result.data),
               tap(videos => {
                 videosOverviewResult[key].push(immutableAssign(object, { videos }))
               })
@@ -56,11 +54,13 @@ export class OverviewService {
       }
     }
 
+    if (observables.length === 0) return of(videosOverviewResult)
+
     return forkJoin(observables)
       .pipe(
         // Translate categories
         switchMap(() => {
-          return this.serverService.localeObservable
+          return this.serverService.getServerLocale()
               .pipe(
                 tap(translations => {
                   for (const c of videosOverviewResult.categories) {