Change loading posts from 80% to 100%
This commit is contained in:
parent
85e152f6e8
commit
f5b708aafe
1 changed files with 2 additions and 5 deletions
|
|
@ -21,13 +21,10 @@ class PostList extends React.Component {
|
|||
}
|
||||
|
||||
checkScrollHeight(e) {
|
||||
const currentHeight = window.scrollY + window.innerHeight;
|
||||
const totalHeight = document.body.offsetHeight;
|
||||
|
||||
const currentPercentage = (currentHeight / totalHeight) * 100;
|
||||
const postList = document.body.querySelector('.posts__list');
|
||||
|
||||
if (this.props.next && !this.props.lastReached) {
|
||||
if (currentPercentage > 60 && !this.props.isFetching) {
|
||||
if (window.scrollY + window.innerHeight >= postList.offsetHeight) {
|
||||
this.paginate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue