diff options
Diffstat (limited to 'client/src/app/header')
-rw-r--r-- | client/src/app/header/search-typeahead.component.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts index d0350368d..2bf1072f4 100644 --- a/client/src/app/header/search-typeahead.component.ts +++ b/client/src/app/header/search-typeahead.component.ts | |||
@@ -36,7 +36,7 @@ export class SearchTypeaheadComponent implements OnInit, OnDestroy { | |||
36 | 36 | ||
37 | ngOnInit () { | 37 | ngOnInit () { |
38 | this.route.queryParams | 38 | this.route.queryParams |
39 | .pipe(first(params => params.search !== undefined && params.search !== null)) | 39 | .pipe(first(params => this.isOnSearch() && params.search !== undefined && params.search !== null)) |
40 | .subscribe(params => this.search = params.search) | 40 | .subscribe(params => this.search = params.search) |
41 | this.serverService.getConfig() | 41 | this.serverService.getConfig() |
42 | .subscribe(config => this.serverConfig = config) | 42 | .subscribe(config => this.serverConfig = config) |
@@ -146,11 +146,15 @@ export class SearchTypeaheadComponent implements OnInit, OnDestroy { | |||
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | isOnSearch () { | ||
150 | return window.location.pathname === '/search' | ||
151 | } | ||
152 | |||
149 | doSearch () { | 153 | doSearch () { |
150 | this.newSearch = false | 154 | this.newSearch = false |
151 | const queryParams: Params = {} | 155 | const queryParams: Params = {} |
152 | 156 | ||
153 | if (window.location.pathname === '/search' && this.route.snapshot.queryParams) { | 157 | if (this.isOnSearch() && this.route.snapshot.queryParams) { |
154 | Object.assign(queryParams, this.route.snapshot.queryParams) | 158 | Object.assign(queryParams, this.route.snapshot.queryParams) |
155 | } | 159 | } |
156 | 160 | ||