aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/search.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-11 16:58:33 +0100
committerChocobozzz <me@florianbigard.com>2019-01-14 09:07:08 +0100
commit033bc0efc2ab2c517b4d7d53d09930b85f092b50 (patch)
tree7bc44c9a4af27e52d24a72a158a5f530bd5ae56b /client/src/app/search/search.component.ts
parentc32bf839c11557cac527ca5f181d1ce39fc80974 (diff)
downloadPeerTube-033bc0efc2ab2c517b4d7d53d09930b85f092b50.tar.gz
PeerTube-033bc0efc2ab2c517b4d7d53d09930b85f092b50.tar.zst
PeerTube-033bc0efc2ab2c517b4d7d53d09930b85f092b50.zip
Fix NSFW blur on search
Diffstat (limited to 'client/src/app/search/search.component.ts')
-rw-r--r--client/src/app/search/search.component.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 474b72824..c4a4b1fde 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -1,6 +1,6 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier, ServerService } from '@app/core'
4import { forkJoin, Subscription } from 'rxjs' 4import { forkJoin, Subscription } from 'rxjs'
5import { SearchService } from '@app/search/search.service' 5import { SearchService } from '@app/search/search.service'
6import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 6import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
@@ -41,7 +41,8 @@ export class SearchComponent implements OnInit, OnDestroy {
41 private metaService: MetaService, 41 private metaService: MetaService,
42 private notifier: Notifier, 42 private notifier: Notifier,
43 private searchService: SearchService, 43 private searchService: SearchService,
44 private authService: AuthService 44 private authService: AuthService,
45 private serverService: ServerService
45 ) { } 46 ) { }
46 47
47 ngOnInit () { 48 ngOnInit () {
@@ -75,6 +76,10 @@ export class SearchComponent implements OnInit, OnDestroy {
75 if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() 76 if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe()
76 } 77 }
77 78
79 isVideoBlur (video: Video) {
80 return video.isVideoNSFWForUser(this.authService.getUser(), this.serverService.getConfig())
81 }
82
78 isVideoChannel (d: VideoChannel | Video): d is VideoChannel { 83 isVideoChannel (d: VideoChannel | Video): d is VideoChannel {
79 return d instanceof VideoChannel 84 return d instanceof VideoChannel
80 } 85 }