X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fsearch%2Fsearch.component.ts;h=475fdd277628469bf1a821097612367edd3da591;hb=9a0fc8409c7a783348ec212fa9f38d0a98413467;hp=4c540ca72b2b467d57affba42ad2a36ece9e592a;hpb=26fabbd6d4d5cb6c867d16ad6db6a8de0cf484ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 4c540ca72..475fdd277 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -31,6 +31,7 @@ export class SearchComponent implements OnInit, OnDestroy { private subActivatedRoute: Subscription private isInitialLoad = true + private firstSearch = true private channelsPerPage = 2 @@ -103,13 +104,16 @@ export class SearchComponent implements OnInit, OnDestroy { .concat(videosResult.videos) this.pagination.totalItems = videosResult.totalVideos + videoChannelsResult.total - // Focus on channels - if (this.channelsPerPage !== 10 && videosResult.videos.length < this.pagination.itemsPerPage) { + // Focus on channels if there are no enough videos + if (this.firstSearch === true && videosResult.videos.length < this.pagination.itemsPerPage) { this.resetPagination() + this.firstSearch = false this.channelsPerPage = 10 this.search() } + + this.firstSearch = false }, error => {