X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-video-miniature%2Fabstract-video-list.ts;h=c13cb37487cde7065780430eb8c565105e35e82d;hb=15bedeebd7671bf5177879899404d48942b2d090;hp=f8abc1656d45a767f5ddb03172c46841502a9b48;hpb=94d721efdc9a8c2cda612f49506a41adb6a06f1d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts index f8abc1656..c13cb3748 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts @@ -11,7 +11,7 @@ import { ViewChild, ViewContainerRef } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' +import { ActivatedRoute, Params, Router } from '@angular/router' import { AuthService, ComponentPaginationLight, @@ -199,6 +199,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte // No more results if (this.lastQueryLength !== undefined && this.lastQueryLength < this.pagination.itemsPerPage) return + console.log('near of bottom') this.pagination.currentPage += 1 this.setScrollRouteParams() @@ -322,10 +323,17 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte // On videos hook for children that want to do something protected onMoreVideos () { /* empty */ } - protected loadRouteParams (routeParams: { [ key: string ]: any }) { - this.sort = routeParams[ 'sort' ] as VideoSortField || this.defaultSort - this.categoryOneOf = routeParams[ 'categoryOneOf' ] - this.angularState = routeParams[ 'a-state' ] + protected load () { /* empty */ } + + // Hook if the page has custom route params + protected loadPageRouteParams (_queryParams: Params) { /* empty */ } + + protected loadRouteParams (queryParams: Params) { + this.sort = queryParams[ 'sort' ] as VideoSortField || this.defaultSort + this.categoryOneOf = queryParams[ 'categoryOneOf' ] + this.angularState = queryParams[ 'a-state' ] + + this.loadPageRouteParams(queryParams) } protected buildLocalFilter (existing: VideoFilter, base: VideoFilter) {