diff --git a/src/controllers/Lane.js b/src/controllers/Lane.js index 3a8303a8..be4a0f10 100644 --- a/src/controllers/Lane.js +++ b/src/controllers/Lane.js @@ -19,7 +19,8 @@ class Lane extends Component { currentPage: this.props.currentPage, addCardMode: false, collapsed: false, - isDraggingOver: false + isDraggingOver: false, + isPageLast: false } handleScroll = evt => { @@ -27,7 +28,7 @@ class Lane extends Component { const elemScrollPosition = node.scrollHeight - node.scrollTop - node.clientHeight const {onLaneScroll} = this.props // In some browsers and/or screen sizes a decimal rest value between 0 and 1 exists, so it should be checked on < 1 instead of < 0 - if (elemScrollPosition < 1 && onLaneScroll && !this.state.loading) { + if (elemScrollPosition < 1 && onLaneScroll && !this.state.loading && !this.state.isPageLast) { const {currentPage} = this.state this.setState({loading: true}) const nextPage = currentPage + 1 @@ -38,6 +39,8 @@ class Lane extends Component { newCards: moreCards, nextPage: nextPage }) + } else { + this.setState({isPageLast: true}); } this.setState({loading: false}) })