diff --git a/app/soapbox/components/status_list.js b/app/soapbox/components/status_list.js index a21884810..97c5a11d7 100644 --- a/app/soapbox/components/status_list.js +++ b/app/soapbox/components/status_list.js @@ -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) { diff --git a/app/soapbox/features/ui/containers/status_list_container.js b/app/soapbox/features/ui/containers/status_list_container.js index 03afa4b88..41c345df3 100644 --- a/app/soapbox/features/ui/containers/status_list_container.js +++ b/app/soapbox/features/ui/containers/status_list_container.js @@ -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']),