From: Chocobozzz Date: Mon, 1 Oct 2018 15:39:09 +0000 (+0200) Subject: Don't throw an error on empty search X-Git-Tag: v1.0.0-rc.1~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=478796690075a8868bf39a33f3ead80cf0040f42;p=oweals%2Fpeertube.git Don't throw an error on empty search --- diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index b86b5083a..911d56843 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -51,15 +51,12 @@ export class SearchComponent implements OnInit, OnDestroy { queryParams => { const querySearch = queryParams['search'] - // New empty search - if (this.currentSearch && !querySearch) return this.redirectService.redirectToHomepage() - // Search updated, reset filters if (this.currentSearch !== querySearch) { this.resetPagination() this.advancedSearch.reset() - this.currentSearch = querySearch + this.currentSearch = querySearch || undefined this.updateTitle() } @@ -154,7 +151,7 @@ export class SearchComponent implements OnInit, OnDestroy { } private updateUrlFromAdvancedSearch () { - const search = (this.currentSearch && this.currentSearch !== '') ? this.currentSearch : undefined + const search = this.currentSearch || undefined this.router.navigate([], { relativeTo: this.route,