Skip to content

Commit

Permalink
Load images before reaching bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ksho committed Dec 19, 2021
1 parent 30709a0 commit 7407db6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/components/Album.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export default class Album extends Component<IOwnProps, IOwnState> {
}

isBottom(el: HTMLElement) {
return el.getBoundingClientRect().bottom <= window.innerHeight;
// 1000px from the bottom
return el.getBoundingClientRect().bottom <= window.innerHeight + 1000;
}

trackScrolling = () => {
Expand Down

1 comment on commit 7407db6

@vercel
Copy link

@vercel vercel bot commented on 7407db6 Dec 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.