diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-04 13:29:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-04 13:29:40 +0100 |
commit | 44df5c755c31798e64eba1ec41dd7e2d7ef50e56 (patch) | |
tree | 09a7d6b64cd635824b1609981ceb4487cdbf49e0 | |
parent | 66fd15160e633d98fd7933ffe4abb6c55fcd1755 (diff) | |
download | PeerTube-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.ts | 4 |
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 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier } from '@app/core' |
4 | import { forkJoin, Subscription } from 'rxjs' | 4 | import { forkJoin, of, Subscription } from 'rxjs' |
5 | import { SearchService } from '@app/search/search.service' | 5 | import { SearchService } from '@app/search/search.service' |
6 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 6 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { 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 }) |