]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+about/about-follows/about-follows.component.ts
Fix infinite scroll on big screens
[github/Chocobozzz/PeerTube.git] / client / src / app / +about / about-follows / about-follows.component.ts
index f0e1375d66e4d5d34256b3c8d63cf4a1a08f613d..d6030792864892728ca805721f67165e94c4c014 100644 (file)
@@ -4,6 +4,7 @@ import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pa
 import { Notifier } from '@app/core'
 import { RestService } from '@app/shared'
 import { SortMeta } from 'primeng/api'
+import { Subject } from 'rxjs'
 
 @Component({
   selector: 'my-about-follows',
@@ -17,13 +18,13 @@ export class AboutFollowsComponent implements OnInit {
 
   followersPagination: ComponentPagination = {
     currentPage: 1,
-    itemsPerPage: 40,
+    itemsPerPage: 20,
     totalItems: null
   }
 
   followingsPagination: ComponentPagination = {
     currentPage: 1,
-    itemsPerPage: 40,
+    itemsPerPage: 20,
     totalItems: null
   }
 
@@ -32,6 +33,8 @@ export class AboutFollowsComponent implements OnInit {
     order: -1
   }
 
+  onDataSubject = new Subject<any[]>()
+
   constructor (
     private restService: RestService,
     private notifier: Notifier,
@@ -78,6 +81,8 @@ export class AboutFollowsComponent implements OnInit {
             this.followers = this.followers.concat(newFollowers)
 
             this.followersPagination.totalItems = resultList.total
+
+            this.onDataSubject.next(newFollowers)
           },
 
           err => this.notifier.error(err.message)
@@ -94,6 +99,8 @@ export class AboutFollowsComponent implements OnInit {
             this.followings = this.followings.concat(newFollowings)
 
             this.followingsPagination.totalItems = resultList.total
+
+            this.onDataSubject.next(newFollowings)
           },
 
           err => this.notifier.error(err.message)