Compare commits

...

2 Commits

Author SHA1 Message Date
2af6054091 Fix the last eslint warnings
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2020-04-03 19:08:56 +02:00
56dbd65730 Fix infinite scroll on the poster list 2020-04-03 19:07:31 +02:00
3 changed files with 8 additions and 5 deletions

View File

@ -98,6 +98,7 @@ const Posters = ({
const [size, setSize] = useState(0);
const [postersPerRow, setPostersPerRow] = useState(0);
const [posterHeight, setPosterHeight] = useState(0);
const [initialLoading, setInitialLoading] = useState(true);
const loadMore = useCallback(() => {
if (size === elmts.size) {
@ -111,8 +112,11 @@ const Posters = ({
}, [size, elmts.size]);
useEffect(() => {
loadMore();
}, [elmts.size, loadMore]);
if (initialLoading) {
loadMore();
setInitialLoading(false);
}
}, [loadMore, initialLoading, setInitialLoading]);
const move = useCallback(
(event) => {

View File

@ -1,5 +1,4 @@
import React, { useState } from "react";
import PropTypes from "prop-types";
import { useDispatch, useSelector } from "react-redux";
import { Redirect, Link } from "react-router-dom";

View File

@ -60,8 +60,8 @@ const handlers = {
return state.mergeIn(
["shows", action.payload.imdbId],
Map({
tracked_season: season,
tracked_episode: episode,
tracked_season: season, // eslint-disable-line camelcase
tracked_episode: episode, // eslint-disable-line camelcase
})
);
},