diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-13 14:11:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-13 14:20:46 +0100 |
commit | 0cd4344f3cf529b15308fcf3eb7d7eb07726df56 (patch) | |
tree | 276f6e8cfe72d583114d82fd5db981550a395488 /client/src/app/videos/video-list/video-trending.component.ts | |
parent | 29c6b829446a6fb29dffc6b7b638079ce60f3771 (diff) | |
download | PeerTube-0cd4344f3cf529b15308fcf3eb7d7eb07726df56.tar.gz PeerTube-0cd4344f3cf529b15308fcf3eb7d7eb07726df56.tar.zst PeerTube-0cd4344f3cf529b15308fcf3eb7d7eb07726df56.zip |
Rewrite infinite scroll
Diffstat (limited to 'client/src/app/videos/video-list/video-trending.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/video-trending.component.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index fc48086d6..a42457273 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | ||
3 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
4 | import { AuthService } from '../../core/auth' | 5 | import { AuthService } from '../../core/auth' |
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
@@ -28,7 +29,8 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit | |||
28 | super.ngOnInit() | 29 | super.ngOnInit() |
29 | } | 30 | } |
30 | 31 | ||
31 | getVideosObservable () { | 32 | getVideosObservable (page: number) { |
32 | return this.videoService.getVideos(this.pagination, this.sort) | 33 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
34 | return this.videoService.getVideos(newPagination, this.sort) | ||
33 | } | 35 | } |
34 | } | 36 | } |