Skip to content

Commit

Permalink
fix bug in Random image
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Mar 14, 2019
1 parent 117b4f0 commit 33915d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/RandomImage.js
Expand Up @@ -20,7 +20,7 @@ function RandomImage(props) {
api.unsplash.random
)

const needsFetch = !error && !updating && (!imgs || cacheIndex > cache.length - 2)
const needsFetch = !error && !updating && (!imgs || cacheIndex > cacheRef.current.length - 2)

React.useEffect(() => {
if (needsFetch) {
Expand Down

0 comments on commit 33915d4

Please sign in to comment.