diff options
Diffstat (limited to 'client/src/app/search/search.component.ts')
-rw-r--r-- | client/src/app/search/search.component.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 3d17e6d96..c4a4b1fde 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService } from '@app/core' | 3 | import { AuthService, Notifier, ServerService } from '@app/core' |
4 | import { NotificationsService } from 'angular2-notifications' | ||
5 | import { forkJoin, Subscription } from 'rxjs' | 4 | import { forkJoin, Subscription } from 'rxjs' |
6 | import { SearchService } from '@app/search/search.service' | 5 | import { SearchService } from '@app/search/search.service' |
7 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 6 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
@@ -40,9 +39,10 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
40 | private route: ActivatedRoute, | 39 | private route: ActivatedRoute, |
41 | private router: Router, | 40 | private router: Router, |
42 | private metaService: MetaService, | 41 | private metaService: MetaService, |
43 | private notificationsService: NotificationsService, | 42 | private notifier: Notifier, |
44 | private searchService: SearchService, | 43 | private searchService: SearchService, |
45 | private authService: AuthService | 44 | private authService: AuthService, |
45 | private serverService: ServerService | ||
46 | ) { } | 46 | ) { } |
47 | 47 | ||
48 | ngOnInit () { | 48 | ngOnInit () { |
@@ -68,7 +68,7 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
68 | this.search() | 68 | this.search() |
69 | }, | 69 | }, |
70 | 70 | ||
71 | err => this.notificationsService.error('Error', err.text) | 71 | err => this.notifier.error(err.text) |
72 | ) | 72 | ) |
73 | } | 73 | } |
74 | 74 | ||
@@ -76,6 +76,10 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
76 | if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() | 76 | if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() |
77 | } | 77 | } |
78 | 78 | ||
79 | isVideoBlur (video: Video) { | ||
80 | return video.isVideoNSFWForUser(this.authService.getUser(), this.serverService.getConfig()) | ||
81 | } | ||
82 | |||
79 | isVideoChannel (d: VideoChannel | Video): d is VideoChannel { | 83 | isVideoChannel (d: VideoChannel | Video): d is VideoChannel { |
80 | return d instanceof VideoChannel | 84 | return d instanceof VideoChannel |
81 | } | 85 | } |
@@ -112,9 +116,7 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
112 | this.firstSearch = false | 116 | this.firstSearch = false |
113 | }, | 117 | }, |
114 | 118 | ||
115 | error => { | 119 | err => this.notifier.error(err.message) |
116 | this.notificationsService.error(this.i18n('Error'), error.message) | ||
117 | } | ||
118 | ) | 120 | ) |
119 | 121 | ||
120 | } | 122 | } |