Skip to content

fix: you should check hasMore before loadMore #193

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

success-cg
Copy link

@success-cg success-cg commented Nov 26, 2018

you should check hasMore before loadMore function be called,because in my project,I find a bug:
there is not any more data from server, and props.hasMore is false, but your InfiniteScroller will be loadMore once more again. By the way, it's a h5-mobile web. I was debugger , find the offset will be less than 0, such as -78 by calculate, so even if the hasMore is false, but the loadMore function will be called once more;
I think, you should check hasMore before loadMore function be called;

@joshuaobrien
Copy link

You probably didn't intend to, but you've made unnecessary changes to yarn.lock, as well as deleted dist.

@@ -1,385 +0,0 @@
'use strict';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't have been deleted. After making your changes, you should generate a new dist file. This can be done by running npm run build.

@@ -4,3 +4,4 @@ npm-debug.log
.idea
.nyc_output
coverage
dist/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be ignored

@@ -202,6 +202,14 @@ array-unique@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"

array.prototype.flat@^1.2.1:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the nature of this PR, I don't think the lockfile should be updated

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants