diff options
Diffstat (limited to 'client/src/app/header/header.component.ts')
-rw-r--r-- | client/src/app/header/header.component.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 42de2dd92..9d2a83773 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { filter, map } from 'rxjs/operators' | ||
1 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
2 | import { Router, NavigationEnd } from '@angular/router' | 3 | import { NavigationEnd, Router } from '@angular/router' |
3 | import { getParameterByName } from '../shared/misc/utils' | 4 | import { getParameterByName } from '../shared/misc/utils' |
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
@@ -15,9 +16,11 @@ export class HeaderComponent implements OnInit { | |||
15 | 16 | ||
16 | ngOnInit () { | 17 | ngOnInit () { |
17 | this.router.events | 18 | this.router.events |
18 | .filter(e => e instanceof NavigationEnd) | 19 | .pipe( |
19 | .map(() => getParameterByName('search', window.location.href)) | 20 | filter(e => e instanceof NavigationEnd), |
20 | .filter(searchQuery => !!searchQuery) | 21 | map(() => getParameterByName('search', window.location.href)), |
22 | filter(searchQuery => !!searchQuery) | ||
23 | ) | ||
21 | .subscribe(searchQuery => this.searchValue = searchQuery) | 24 | .subscribe(searchQuery => this.searchValue = searchQuery) |
22 | } | 25 | } |
23 | 26 | ||