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
manage-followers-section
Alex Gleason 2020-08-26 19:43:32 +00:00
commit 96ccf02ab8
2 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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) {

Wyświetl plik

@ -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']),