diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-17 15:11:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-17 15:11:12 +0200 |
commit | 66dc59076413b9a4aa0899d3192b0bdf03ee654d (patch) | |
tree | 7743a66a4d7a9fb1dba1d4d744c059dcd35c9224 /client/src/app/header/header.component.ts | |
parent | 4195cd2bc5046d4cdf1c677c27cd41f427d7a13a (diff) | |
download | PeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.tar.gz PeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.tar.zst PeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.zip |
Add ability to click on the account in watch page
Diffstat (limited to 'client/src/app/header/header.component.ts')
-rw-r--r-- | client/src/app/header/header.component.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 6b0ee67ff..42de2dd92 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Router } from '@angular/router' | 2 | import { Router, NavigationEnd } from '@angular/router' |
3 | import { getParameterByName } from '../shared/misc/utils' | 3 | import { getParameterByName } from '../shared/misc/utils' |
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
@@ -14,8 +14,11 @@ export class HeaderComponent implements OnInit { | |||
14 | constructor (private router: Router) {} | 14 | constructor (private router: Router) {} |
15 | 15 | ||
16 | ngOnInit () { | 16 | ngOnInit () { |
17 | const searchQuery = getParameterByName('search', window.location.href) | 17 | this.router.events |
18 | if (searchQuery) this.searchValue = searchQuery | 18 | .filter(e => e instanceof NavigationEnd) |
19 | .map(() => getParameterByName('search', window.location.href)) | ||
20 | .filter(searchQuery => !!searchQuery) | ||
21 | .subscribe(searchQuery => this.searchValue = searchQuery) | ||
19 | } | 22 | } |
20 | 23 | ||
21 | doSearch () { | 24 | doSearch () { |