From ad453580b20056fd80b3245d4db554f5ca1a5e29 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 2 Aug 2019 14:49:25 +0200 Subject: Fix infinite scroll on big screens --- .../video-playlist/video-add-to-playlist.component.ts | 2 +- .../app/shared/video-playlist/video-playlist.service.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/video-playlist') diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts index 08ceb21bc..72de84703 100644 --- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts +++ b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts @@ -83,7 +83,7 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, load () { forkJoin([ - this.videoPlaylistService.listAccountPlaylists(this.user.account, '-updatedAt'), + this.videoPlaylistService.listAccountPlaylists(this.user.account, undefined,'-updatedAt'), this.videoPlaylistService.doesVideoExistInPlaylist(this.video.id) ]) .subscribe( diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/video-playlist/video-playlist.service.ts index b93a19356..376387082 100644 --- a/client/src/app/shared/video-playlist/video-playlist.service.ts +++ b/client/src/app/shared/video-playlist/video-playlist.service.ts @@ -45,21 +45,28 @@ export class VideoPlaylistService { ) } - listChannelPlaylists (videoChannel: VideoChannel): Observable> { + listChannelPlaylists (videoChannel: VideoChannel, componentPagination: ComponentPagination): Observable> { const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.nameWithHost + '/video-playlists' + const pagination = this.restService.componentPaginationToRestPagination(componentPagination) - return this.authHttp.get>(url) + let params = new HttpParams() + params = this.restService.addRestGetParams(params, pagination) + + return this.authHttp.get>(url, { params }) .pipe( switchMap(res => this.extractPlaylists(res)), catchError(err => this.restExtractor.handleError(err)) ) } - listAccountPlaylists (account: Account, sort: string): Observable> { + listAccountPlaylists (account: Account, componentPagination: ComponentPagination, sort: string): Observable> { const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-playlists' + const pagination = componentPagination + ? this.restService.componentPaginationToRestPagination(componentPagination) + : undefined let params = new HttpParams() - params = this.restService.addRestGetParams(params, undefined, sort) + params = this.restService.addRestGetParams(params, pagination, sort) return this.authHttp.get>(url, { params }) .pipe( -- cgit v1.2.3