aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-07 17:06:00 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commitf0a3988066f72a28bb44520af072f18d91d77dde (patch)
treedfa3a92102557b567530c5dd014c90866621140a /client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
parent830b4faff15fb9c81d88e8e69fcdf94aad32bef8 (diff)
downloadPeerTube-f0a3988066f72a28bb44520af072f18d91d77dde.tar.gz
PeerTube-f0a3988066f72a28bb44520af072f18d91d77dde.tar.zst
PeerTube-f0a3988066f72a28bb44520af072f18d91d77dde.zip
Add to playlist dropdown
Diffstat (limited to 'client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
index 761ce90e8..e30656b92 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
@@ -69,17 +69,20 @@ export class MyAccountVideoPlaylistsComponent implements OnInit {
69 return playlist.type.id === VideoPlaylistType.REGULAR 69 return playlist.type.id === VideoPlaylistType.REGULAR
70 } 70 }
71 71
72 private loadVideoPlaylists () { 72 onNearOfBottom () {
73 this.authService.userInformationLoaded
74 .pipe(flatMap(() => this.videoPlaylistService.listAccountPlaylists(this.user.account)))
75 .subscribe(res => this.videoPlaylists = res.data)
76 }
77
78 private ofNearOfBottom () {
79 // Last page 73 // Last page
80 if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return 74 if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return
81 75
82 this.pagination.currentPage += 1 76 this.pagination.currentPage += 1
83 this.loadVideoPlaylists() 77 this.loadVideoPlaylists()
84 } 78 }
79
80 private loadVideoPlaylists () {
81 this.authService.userInformationLoaded
82 .pipe(flatMap(() => this.videoPlaylistService.listAccountPlaylists(this.user.account, '-updatedAt')))
83 .subscribe(res => {
84 this.videoPlaylists = this.videoPlaylists.concat(res.data)
85 this.pagination.totalItems = res.total
86 })
87 }
85} 88}