Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/Albums/Albums.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Albums() {

//fetch next albums when you reach the bottom of the current list
const onScroll = (e: any) => {
const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight;
const bottom = Math.abs(e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight) < 2;
if (bottom && albums && albums.offset < albums.total) {
const limit = albums.limit;
const offset = albums.offset + limit;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Playlists/Playlists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Playlists() {

//fetch next playlists when you reach the bottom of the current list
const onScroll = (e: any) => {
const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight;
const bottom = Math.abs(e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight) < 2;
if (bottom && playlists && playlists.offset < playlists.total) {
const limit = playlists.limit;
const offset = playlists.offset + limit;
Expand Down