From 44df5c755c31798e64eba1ec41dd7e2d7ef50e56 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Dec 2019 13:29:40 +0100 Subject: Skip channel search on empty search --- client/src/app/search/search.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/app/search') 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 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { AuthService, Notifier } from '@app/core' -import { forkJoin, Subscription } from 'rxjs' +import { forkJoin, of, Subscription } from 'rxjs' import { SearchService } from '@app/search/search.service' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' import { I18n } from '@ngx-translate/i18n-polyfill' @@ -184,6 +184,8 @@ export class SearchComponent implements OnInit, OnDestroy { } private getVideoChannelObs () { + if (!this.currentSearch) return of({ data: [], total: 0 }) + const params = { search: this.currentSearch, componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.channelsPerPage }) -- cgit v1.2.3