diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-15 11:55:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:54 +0200 |
commit | db400f447a9f7aae1c56fa25396e93069744483f (patch) | |
tree | f45af832a5d3f4eebafd2f885b7413d9f84fa374 /client/src/app/header | |
parent | 54c3a22faa04bf13eea37f39be9149fc5eb95737 (diff) | |
download | PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.gz PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.zst PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.zip |
Upgrade to rxjs 6
Diffstat (limited to 'client/src/app/header')
-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 | ||