From ff644b3066e18f232ce0b9de9129f34d42d3f35d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Jun 2018 11:03:44 +0200 Subject: [PATCH] Reset search on page change --- client/src/app/header/header.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 9d2a83773..0e999fbb1 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts @@ -18,10 +18,9 @@ export class HeaderComponent implements OnInit { this.router.events .pipe( filter(e => e instanceof NavigationEnd), - map(() => getParameterByName('search', window.location.href)), - filter(searchQuery => !!searchQuery) + map(() => getParameterByName('search', window.location.href)) ) - .subscribe(searchQuery => this.searchValue = searchQuery) + .subscribe(searchQuery => this.searchValue = searchQuery || '') } doSearch () { -- 2.25.1