Merge branch '340-load-more-community-fix' into 'develop'
Pass last statusID into status list before filtering, fixes #340 Closes #340 See merge request soapbox-pub/soapbox-fe!188
This commit is contained in:
commit
96ccf02ab8
2 changed files with 5 additions and 1 deletions
|
@ -18,6 +18,7 @@ export default class StatusList extends ImmutablePureComponent {
|
|||
static propTypes = {
|
||||
scrollKey: PropTypes.string.isRequired,
|
||||
statusIds: ImmutablePropTypes.list.isRequired,
|
||||
lastStatusId: PropTypes.string,
|
||||
featuredStatusIds: ImmutablePropTypes.list,
|
||||
onLoadMore: PropTypes.func,
|
||||
isLoading: PropTypes.bool,
|
||||
|
@ -62,7 +63,8 @@ export default class StatusList extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
handleLoadOlder = debounce(() => {
|
||||
this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
|
||||
const loadMoreID = this.props.lastStatusId ? this.props.lastStatusId : this.props.statusIds.last();
|
||||
this.props.onLoadMore(loadMoreID);
|
||||
}, 300, { leading: true })
|
||||
|
||||
_selectChild(index, align_top) {
|
||||
|
|
|
@ -22,10 +22,12 @@ const makeGetStatusIds = () => createSelector([
|
|||
});
|
||||
|
||||
const mapStateToProps = (state, { timelineId }) => {
|
||||
const lastStatusId = state.getIn(['timelines', timelineId, 'items'], ImmutableList()).last();
|
||||
const getStatusIds = makeGetStatusIds();
|
||||
|
||||
return {
|
||||
statusIds: getStatusIds(state, { type: timelineId }),
|
||||
lastStatusId: lastStatusId,
|
||||
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
||||
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
||||
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
||||
|
|
Loading…
Reference in a new issue