Skip to content

Commit

Permalink
Merge pull request #430 from gevhambarzumyan93/master
Browse files Browse the repository at this point in the history
fix infinite lane scroll
  • Loading branch information
dapi authored Feb 26, 2021
2 parents 7c7b7c8 + 41de86e commit c4a5965
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/controllers/Lane.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ class Lane extends Component {
this.setState({loading: true})
const nextPage = currentPage + 1
onLaneScroll(nextPage, this.props.id).then(moreCards => {
if (!moreCards || moreCards.length === 0) {
// if no cards present, stop retrying until user action
node.scrollTop = node.scrollTop - 100
} else {
if ((moreCards || []).length > 0) {
this.props.actions.paginateLane({
laneId: this.props.id,
newCards: moreCards,
Expand All @@ -50,7 +47,7 @@ class Lane extends Component {
sortCards(cards, sortFunction) {
if (!cards) return []
if (!sortFunction) return cards
return cards.concat().sort(function(card1, card2) {
return cards.concat().sort(function (card1, card2) {
return sortFunction(card1, card2)
})
}
Expand Down Expand Up @@ -331,7 +328,4 @@ const mapDispatchToProps = dispatch => ({
actions: bindActionCreators(laneActions, dispatch)
})

export default connect(
null,
mapDispatchToProps
)(Lane)
export default connect(null, mapDispatchToProps)(Lane)

0 comments on commit c4a5965

Please sign in to comment.