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-channel-playlists/video-channel-playlists.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts') diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts index 7990044a2..0b0033082 100644 --- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts +++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ConfirmService } from '../../core/confirm' import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' -import { Subscription } from 'rxjs' +import { Subject, Subscription } from 'rxjs' import { Notifier } from '@app/core' import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' @@ -22,6 +22,8 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy { totalItems: null } + onDataSubject = new Subject() + private videoChannelSub: Subscription private videoChannel: VideoChannel @@ -53,10 +55,12 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy { } private loadVideoPlaylists () { - this.videoPlaylistService.listChannelPlaylists(this.videoChannel) + this.videoPlaylistService.listChannelPlaylists(this.videoChannel, this.pagination) .subscribe(res => { this.videoPlaylists = this.videoPlaylists.concat(res.data) this.pagination.totalItems = res.total + + this.onDataSubject.next(res.data) }) } } -- cgit v1.2.3