Skip to content

Commit c4a5965

Browse files
authored
Merge pull request #430 from gevhambarzumyan93/master
fix infinite lane scroll
2 parents 7c7b7c8 + 41de86e commit c4a5965

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/controllers/Lane.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ class Lane extends Component {
3232
this.setState({loading: true})
3333
const nextPage = currentPage + 1
3434
onLaneScroll(nextPage, this.props.id).then(moreCards => {
35-
if (!moreCards || moreCards.length === 0) {
36-
// if no cards present, stop retrying until user action
37-
node.scrollTop = node.scrollTop - 100
38-
} else {
35+
if ((moreCards || []).length > 0) {
3936
this.props.actions.paginateLane({
4037
laneId: this.props.id,
4138
newCards: moreCards,
@@ -50,7 +47,7 @@ class Lane extends Component {
5047
sortCards(cards, sortFunction) {
5148
if (!cards) return []
5249
if (!sortFunction) return cards
53-
return cards.concat().sort(function(card1, card2) {
50+
return cards.concat().sort(function (card1, card2) {
5451
return sortFunction(card1, card2)
5552
})
5653
}
@@ -331,7 +328,4 @@ const mapDispatchToProps = dispatch => ({
331328
actions: bindActionCreators(laneActions, dispatch)
332329
})
333330

334-
export default connect(
335-
null,
336-
mapDispatchToProps
337-
)(Lane)
331+
export default connect(null, mapDispatchToProps)(Lane)

0 commit comments

Comments
 (0)