aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/header
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/header')
-rw-r--r--client/src/app/header/search-typeahead.component.ts22
1 files changed, 8 insertions, 14 deletions
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts
index c546628ee..b5d76c70e 100644
--- a/client/src/app/header/search-typeahead.component.ts
+++ b/client/src/app/header/search-typeahead.component.ts
@@ -1,10 +1,10 @@
1import { of } from 'rxjs' 1import { of } from 'rxjs'
2import { first, tap } from 'rxjs/operators' 2import { first, tap } from 'rxjs/operators'
3import { ListKeyManager } from '@angular/cdk/a11y' 3import { ListKeyManager } from '@angular/cdk/a11y'
4import { AfterViewChecked, AfterViewInit, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core' 4import { AfterViewChecked, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core'
5import { ActivatedRoute, Params, Router } from '@angular/router' 5import { ActivatedRoute, Params, Router } from '@angular/router'
6import { AuthService, ServerService } from '@app/core' 6import { AuthService, ServerService } from '@app/core'
7import { SearchTargetType, ServerConfig } from '@shared/models' 7import { HTMLServerConfig, SearchTargetType } from '@shared/models'
8import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component' 8import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component'
9 9
10@Component({ 10@Component({
@@ -12,7 +12,7 @@ import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from '.
12 templateUrl: './search-typeahead.component.html', 12 templateUrl: './search-typeahead.component.html',
13 styleUrls: [ './search-typeahead.component.scss' ] 13 styleUrls: [ './search-typeahead.component.scss' ]
14}) 14})
15export class SearchTypeaheadComponent implements OnInit, AfterViewInit, AfterViewChecked, OnDestroy { 15export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDestroy {
16 @ViewChildren(SuggestionComponent) suggestionItems: QueryList<SuggestionComponent> 16 @ViewChildren(SuggestionComponent) suggestionItems: QueryList<SuggestionComponent>
17 17
18 hasChannel = false 18 hasChannel = false
@@ -20,7 +20,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewInit, AfterVie
20 areSuggestionsOpened = true 20 areSuggestionsOpened = true
21 21
22 search = '' 22 search = ''
23 serverConfig: ServerConfig 23 serverConfig: HTMLServerConfig
24 24
25 inThisChannelText: string 25 inThisChannelText: string
26 26
@@ -42,20 +42,14 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewInit, AfterVie
42 this.route.queryParams 42 this.route.queryParams
43 .pipe(first(params => this.isOnSearch() && params.search !== undefined && params.search !== null)) 43 .pipe(first(params => this.isOnSearch() && params.search !== undefined && params.search !== null))
44 .subscribe(params => this.search = params.search) 44 .subscribe(params => this.search = params.search)
45 }
46 45
47 ngAfterViewInit () { 46 this.serverConfig = this.serverService.getHTMLConfig()
48 this.serverService.getConfig() 47 this.computeTypeahead()
48
49 this.serverService.configReloaded
49 .subscribe(config => { 50 .subscribe(config => {
50 this.serverConfig = config 51 this.serverConfig = config
51
52 this.computeTypeahead() 52 this.computeTypeahead()
53
54 this.serverService.configReloaded
55 .subscribe(config => {
56 this.serverConfig = config
57 this.computeTypeahead()
58 })
59 }) 53 })
60 } 54 }
61 55