mirror of https://github.com/Chocobozzz/PeerTube
Don't throw an error on empty search
parent
c2ad546df9
commit
4787966900
|
@ -51,15 +51,12 @@ export class SearchComponent implements OnInit, OnDestroy {
|
||||||
queryParams => {
|
queryParams => {
|
||||||
const querySearch = queryParams['search']
|
const querySearch = queryParams['search']
|
||||||
|
|
||||||
// New empty search
|
|
||||||
if (this.currentSearch && !querySearch) return this.redirectService.redirectToHomepage()
|
|
||||||
|
|
||||||
// Search updated, reset filters
|
// Search updated, reset filters
|
||||||
if (this.currentSearch !== querySearch) {
|
if (this.currentSearch !== querySearch) {
|
||||||
this.resetPagination()
|
this.resetPagination()
|
||||||
this.advancedSearch.reset()
|
this.advancedSearch.reset()
|
||||||
|
|
||||||
this.currentSearch = querySearch
|
this.currentSearch = querySearch || undefined
|
||||||
this.updateTitle()
|
this.updateTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +151,7 @@ export class SearchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateUrlFromAdvancedSearch () {
|
private updateUrlFromAdvancedSearch () {
|
||||||
const search = (this.currentSearch && this.currentSearch !== '') ? this.currentSearch : undefined
|
const search = this.currentSearch || undefined
|
||||||
|
|
||||||
this.router.navigate([], {
|
this.router.navigate([], {
|
||||||
relativeTo: this.route,
|
relativeTo: this.route,
|
||||||
|
|
Loading…
Reference in New Issue