aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/header/header.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/header/header.component.ts')
-rw-r--r--client/src/app/header/header.component.ts11
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 @@
1import { filter, map } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
2import { Router, NavigationEnd } from '@angular/router' 3import { NavigationEnd, Router } from '@angular/router'
3import { getParameterByName } from '../shared/misc/utils' 4import { 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