From 07f81d9deedf4921b8518c2d2b16043167b4c5d5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 Feb 2021 13:47:37 +0100 Subject: Fix NSFW policy on account/channel videos --- .../account-search/account-search.component.ts | 19 ++++++++++--------- .../account-videos/account-videos.component.ts | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'client/src/app/+accounts') diff --git a/client/src/app/+accounts/account-search/account-search.component.ts b/client/src/app/+accounts/account-search/account-search.component.ts index 378aa78c4..dda4bf0c7 100644 --- a/client/src/app/+accounts/account-search/account-search.component.ts +++ b/client/src/app/+accounts/account-search/account-search.component.ts @@ -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' @@ -16,6 +16,7 @@ import { VideoFilter } from '@shared/models' export class AccountSearchComponent extends AbstractVideoList implements OnInit, OnDestroy { titlePage: string loadOnInit = false + loadUserVideoPreferences = true search = '' filter: VideoFilter = null @@ -46,14 +47,14 @@ export class AccountSearchComponent 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.reloadVideos() - this.generateSyndicationList() - }) + this.accountSub = forkJoin([ + this.accountService.accountLoaded.pipe(first()), + this.onUserLoadedSubject.pipe(first()) + ]).subscribe(([ account ]) => { + this.account = account + + this.reloadVideos() + }) } ngOnDestroy () { diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts index da3903d2c..484d60e25 100644 --- a/client/src/app/+accounts/account-videos/account-videos.component.ts +++ b/client/src/app/+accounts/account-videos/account-videos.component.ts @@ -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 () { -- cgit v1.2.3