aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-04 13:29:40 +0100
committerChocobozzz <me@florianbigard.com>2019-12-04 13:29:40 +0100
commit44df5c755c31798e64eba1ec41dd7e2d7ef50e56 (patch)
tree09a7d6b64cd635824b1609981ceb4487cdbf49e0
parent66fd15160e633d98fd7933ffe4abb6c55fcd1755 (diff)
downloadPeerTube-44df5c755c31798e64eba1ec41dd7e2d7ef50e56.tar.gz
PeerTube-44df5c755c31798e64eba1ec41dd7e2d7ef50e56.tar.zst
PeerTube-44df5c755c31798e64eba1ec41dd7e2d7ef50e56.zip
Skip channel search on empty search
-rw-r--r--client/src/app/search/search.component.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 202b97ab3..dfd8d8823 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -1,7 +1,7 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { forkJoin, Subscription } from 'rxjs' 4import { forkJoin, of, Subscription } from 'rxjs'
5import { SearchService } from '@app/search/search.service' 5import { SearchService } from '@app/search/search.service'
6import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 6import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
7import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
@@ -184,6 +184,8 @@ export class SearchComponent implements OnInit, OnDestroy {
184 } 184 }
185 185
186 private getVideoChannelObs () { 186 private getVideoChannelObs () {
187 if (!this.currentSearch) return of({ data: [], total: 0 })
188
187 const params = { 189 const params = {
188 search: this.currentSearch, 190 search: this.currentSearch,
189 componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.channelsPerPage }) 191 componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.channelsPerPage })