aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core')
-rw-r--r--client/src/app/core/routing/custom-reuse-strategy.ts12
-rw-r--r--client/src/app/core/users/user.model.ts5
2 files changed, 11 insertions, 6 deletions
diff --git a/client/src/app/core/routing/custom-reuse-strategy.ts b/client/src/app/core/routing/custom-reuse-strategy.ts
index 3000093a8..1498e221f 100644
--- a/client/src/app/core/routing/custom-reuse-strategy.ts
+++ b/client/src/app/core/routing/custom-reuse-strategy.ts
@@ -1,7 +1,7 @@
1import { Injectable } from '@angular/core' 1import { ComponentRef, Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' 2import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router'
3import { RouterSetting } from './' 3import { DisableForReuseHook } from './disable-for-reuse-hook'
4import { PeerTubeRouterService } from './peertube-router.service' 4import { PeerTubeRouterService, RouterSetting } from './peertube-router.service'
5 5
6@Injectable() 6@Injectable()
7export class CustomReuseStrategy implements RouteReuseStrategy { 7export class CustomReuseStrategy implements RouteReuseStrategy {
@@ -22,9 +22,11 @@ export class CustomReuseStrategy implements RouteReuseStrategy {
22 const key = this.generateKey(route) 22 const key = this.generateKey(route)
23 this.recentlyUsed = key 23 this.recentlyUsed = key
24 24
25 console.log('Storing component %s to reuse later.', key); 25 console.log('Storing component %s to reuse later.', key)
26 26
27 (handle as any).componentRef.instance.disableForReuse() 27 const componentRef = (handle as any).componentRef as ComponentRef<DisableForReuseHook>
28 componentRef.instance.disableForReuse()
29 componentRef.changeDetectorRef.detectChanges()
28 30
29 this.storedRouteHandles.set(key, handle) 31 this.storedRouteHandles.set(key, handle)
30 32
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts
index 00078af5d..c0e5d3169 100644
--- a/client/src/app/core/users/user.model.ts
+++ b/client/src/app/core/users/user.model.ts
@@ -2,6 +2,7 @@ import { Account } from '@app/shared/shared-main/account/account.model'
2import { hasUserRight } from '@shared/core-utils/users' 2import { hasUserRight } from '@shared/core-utils/users'
3import { 3import {
4 ActorImage, 4 ActorImage,
5 HTMLServerConfig,
5 NSFWPolicyType, 6 NSFWPolicyType,
6 User as UserServerModel, 7 User as UserServerModel,
7 UserAdminFlag, 8 UserAdminFlag,
@@ -136,7 +137,9 @@ export class User implements UserServerModel {
136 return this.videoQuota === 0 || this.videoQuotaDaily === 0 137 return this.videoQuota === 0 || this.videoQuotaDaily === 0
137 } 138 }
138 139
139 isAutoBlocked () { 140 isAutoBlocked (serverConfig: HTMLServerConfig) {
141 if (serverConfig.autoBlacklist.videos.ofUsers.enabled !== true) return false
142
140 return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST 143 return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
141 } 144 }
142} 145}