X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fangular%2Fvideos%2Fcomponents%2Flist%2Fvideos-list.component.ts;h=94b064e163aa7654a6ccb4b9863a4518abd117b2;hb=a99593ed9f3244e75f7db793ba6716754d664573;hp=98fe7b15313c21f95ac901e9c9e52f34569a972c;hpb=cf20596c107eb0833259fa1098cc784267298a19;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts index 98fe7b153..94b064e16 100644 --- a/client/angular/videos/components/list/videos-list.component.ts +++ b/client/angular/videos/components/list/videos-list.component.ts @@ -27,7 +27,7 @@ export class VideosListComponent implements OnInit { currentPage: 1, itemsPerPage: 9, total: 0 - } + }; sort: SortField; private search: Search; @@ -41,7 +41,7 @@ export class VideosListComponent implements OnInit { this.search = { value: this._routeParams.get('search'), field: this._routeParams.get('field') - } + }; this.sort = this._routeParams.get('sort') || '-createdDate'; } @@ -78,7 +78,17 @@ export class VideosListComponent implements OnInit { onSort(sort: SortField) { this.sort = sort; - this._router.navigate(['VideosList', { sort: this.sort }]); + + const params: any = { + sort: this.sort + }; + + if (this.search.value) { + params.search = this.search.value; + params.field = this.search.field; + } + + this._router.navigate(['VideosList', params]); this.getVideos(); } }