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 --- .../src/app/+about/about-follows/about-follows.component.html | 2 +- .../src/app/+about/about-follows/about-follows.component.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'client/src/app/+about') 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 @@ -
+
Followers
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 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() + 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) -- cgit v1.2.3