aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/search.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/search/search.component.ts')
-rw-r--r--client/src/app/search/search.component.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index eea015c2e..bed5de79e 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -5,6 +5,7 @@ import { AuthService, Notifier, ServerService } from '@app/core'
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { AdvancedSearch } from '@app/search/advanced-search.model' 6import { AdvancedSearch } from '@app/search/advanced-search.model'
7import { SearchService } from '@app/search/search.service' 7import { SearchService } from '@app/search/search.service'
8import { UserService } from '@app/shared'
8import { immutableAssign } from '@app/shared/misc/utils' 9import { immutableAssign } from '@app/shared/misc/utils'
9import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 10import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
10import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 11import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
@@ -12,7 +13,7 @@ import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.compo
12import { Video } from '@app/shared/video/video.model' 13import { Video } from '@app/shared/video/video.model'
13import { MetaService } from '@ngx-meta/core' 14import { MetaService } from '@ngx-meta/core'
14import { I18n } from '@ngx-translate/i18n-polyfill' 15import { I18n } from '@ngx-translate/i18n-polyfill'
15import { ServerConfig } from '@shared/models' 16import { ServerConfig, User } from '@shared/models'
16import { SearchTargetType } from '@shared/models/search/search-target-query.model' 17import { SearchTargetType } from '@shared/models/search/search-target-query.model'
17 18
18@Component({ 19@Component({
@@ -46,6 +47,8 @@ export class SearchComponent implements OnInit, OnDestroy {
46 errorMessage: string 47 errorMessage: string
47 serverConfig: ServerConfig 48 serverConfig: ServerConfig
48 49
50 userMiniature: User
51
49 private subActivatedRoute: Subscription 52 private subActivatedRoute: Subscription
50 private isInitialLoad = false // set to false to show the search filters on first arrival 53 private isInitialLoad = false // set to false to show the search filters on first arrival
51 private firstSearch = true 54 private firstSearch = true
@@ -62,14 +65,11 @@ export class SearchComponent implements OnInit, OnDestroy {
62 private notifier: Notifier, 65 private notifier: Notifier,
63 private searchService: SearchService, 66 private searchService: SearchService,
64 private authService: AuthService, 67 private authService: AuthService,
68 private userService: UserService,
65 private hooks: HooksService, 69 private hooks: HooksService,
66 private serverService: ServerService 70 private serverService: ServerService
67 ) { } 71 ) { }
68 72
69 get user () {
70 return this.authService.getUser()
71 }
72
73 ngOnInit () { 73 ngOnInit () {
74 this.serverService.getConfig() 74 this.serverService.getConfig()
75 .subscribe(config => this.serverConfig = config) 75 .subscribe(config => this.serverConfig = config)
@@ -103,6 +103,9 @@ export class SearchComponent implements OnInit, OnDestroy {
103 err => this.notifier.error(err.text) 103 err => this.notifier.error(err.text)
104 ) 104 )
105 105
106 this.userService.getAnonymousOrLoggedUser()
107 .subscribe(user => this.userMiniature = user)
108
106 this.hooks.runAction('action:search.init', 'search') 109 this.hooks.runAction('action:search.init', 'search')
107 } 110 }
108 111