aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+about
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-02 14:49:25 +0200
committerChocobozzz <me@florianbigard.com>2019-08-02 14:49:25 +0200
commitad453580b20056fd80b3245d4db554f5ca1a5e29 (patch)
treeed07a6dbd8bc8cd27b22cd33dabcbd3d31deea07 /client/src/app/+about
parentdd570a34ff731a6cd98ef8f8bf83f234e804f6c1 (diff)
downloadPeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.tar.gz
PeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.tar.zst
PeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.zip
Fix infinite scroll on big screens
Diffstat (limited to 'client/src/app/+about')
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.html2
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.ts11
2 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.html b/client/src/app/+about/about-follows/about-follows.component.html
index 18689bbf7..5d7a50c74 100644
--- a/client/src/app/+about/about-follows/about-follows.component.html
+++ b/client/src/app/+about/about-follows/about-follows.component.html
@@ -1,4 +1,4 @@
1<div class="row" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()"> 1<div class="row" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()">
2 <div class="col-xl-6 col-md-12"> 2 <div class="col-xl-6 col-md-12">
3 <div i18n class="subtitle">Followers</div> 3 <div i18n class="subtitle">Followers</div>
4 4
diff --git a/client/src/app/+about/about-follows/about-follows.component.ts b/client/src/app/+about/about-follows/about-follows.component.ts
index f0e1375d6..d60307928 100644
--- a/client/src/app/+about/about-follows/about-follows.component.ts
+++ b/client/src/app/+about/about-follows/about-follows.component.ts
@@ -4,6 +4,7 @@ import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pa
4import { Notifier } from '@app/core' 4import { Notifier } from '@app/core'
5import { RestService } from '@app/shared' 5import { RestService } from '@app/shared'
6import { SortMeta } from 'primeng/api' 6import { SortMeta } from 'primeng/api'
7import { Subject } from 'rxjs'
7 8
8@Component({ 9@Component({
9 selector: 'my-about-follows', 10 selector: 'my-about-follows',
@@ -17,13 +18,13 @@ export class AboutFollowsComponent implements OnInit {
17 18
18 followersPagination: ComponentPagination = { 19 followersPagination: ComponentPagination = {
19 currentPage: 1, 20 currentPage: 1,
20 itemsPerPage: 40, 21 itemsPerPage: 20,
21 totalItems: null 22 totalItems: null
22 } 23 }
23 24
24 followingsPagination: ComponentPagination = { 25 followingsPagination: ComponentPagination = {
25 currentPage: 1, 26 currentPage: 1,
26 itemsPerPage: 40, 27 itemsPerPage: 20,
27 totalItems: null 28 totalItems: null
28 } 29 }
29 30
@@ -32,6 +33,8 @@ export class AboutFollowsComponent implements OnInit {
32 order: -1 33 order: -1
33 } 34 }
34 35
36 onDataSubject = new Subject<any[]>()
37
35 constructor ( 38 constructor (
36 private restService: RestService, 39 private restService: RestService,
37 private notifier: Notifier, 40 private notifier: Notifier,
@@ -78,6 +81,8 @@ export class AboutFollowsComponent implements OnInit {
78 this.followers = this.followers.concat(newFollowers) 81 this.followers = this.followers.concat(newFollowers)
79 82
80 this.followersPagination.totalItems = resultList.total 83 this.followersPagination.totalItems = resultList.total
84
85 this.onDataSubject.next(newFollowers)
81 }, 86 },
82 87
83 err => this.notifier.error(err.message) 88 err => this.notifier.error(err.message)
@@ -94,6 +99,8 @@ export class AboutFollowsComponent implements OnInit {
94 this.followings = this.followings.concat(newFollowings) 99 this.followings = this.followings.concat(newFollowings)
95 100
96 this.followingsPagination.totalItems = resultList.total 101 this.followingsPagination.totalItems = resultList.total
102
103 this.onDataSubject.next(newFollowings)
97 }, 104 },
98 105
99 err => this.notifier.error(err.message) 106 err => this.notifier.error(err.message)