]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+accounts/account-videos/account-videos.component.ts
Fix NSFW policy on account/channel videos
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / account-videos / account-videos.component.ts
index da3903d2c704fa645278839a292b50749c3c453a..484d60e25d3e3354f2c34f13a2ab26d8befa8dc6 100644 (file)
@@ -1,4 +1,4 @@
-import { Subscription } from 'rxjs'
+import { forkJoin, Subscription } from 'rxjs'
 import { first, tap } from 'rxjs/operators'
 import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
@@ -18,6 +18,7 @@ import { VideoFilter } from '@shared/models'
 export class AccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy {
   titlePage: string
   loadOnInit = false
+  loadUserVideoPreferences = true
 
   filter: VideoFilter = null
 
@@ -47,14 +48,15 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
     this.enableAllFilterIfPossible()
 
     // Parent get the account for us
-    this.accountSub = this.accountService.accountLoaded
-                          .pipe(first())
-                          .subscribe(account => {
-                            this.account = account
+    this.accountSub = forkJoin([
+      this.accountService.accountLoaded.pipe(first()),
+      this.onUserLoadedSubject.pipe(first())
+    ]).subscribe(([ account ]) => {
+      this.account = account
 
-                            this.reloadVideos()
-                            this.generateSyndicationList()
-                          })
+      this.reloadVideos()
+      this.generateSyndicationList()
+    })
   }
 
   ngOnDestroy () {