pass last statusID into status list before filtering, fixes #340
This commit is contained in:
parent
22abaafd7a
commit
fbee7a237c
2 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
scrollKey: PropTypes.string.isRequired,
|
scrollKey: PropTypes.string.isRequired,
|
||||||
statusIds: ImmutablePropTypes.list.isRequired,
|
statusIds: ImmutablePropTypes.list.isRequired,
|
||||||
|
lastStatusId: PropTypes.string,
|
||||||
featuredStatusIds: ImmutablePropTypes.list,
|
featuredStatusIds: ImmutablePropTypes.list,
|
||||||
onLoadMore: PropTypes.func,
|
onLoadMore: PropTypes.func,
|
||||||
isLoading: PropTypes.bool,
|
isLoading: PropTypes.bool,
|
||||||
|
@ -62,7 +63,8 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleLoadOlder = debounce(() => {
|
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 ? loadMoreID : undefined);
|
||||||
}, 300, { leading: true })
|
}, 300, { leading: true })
|
||||||
|
|
||||||
_selectChild(index, align_top) {
|
_selectChild(index, align_top) {
|
||||||
|
|
|
@ -8,12 +8,15 @@ import { scrollTopTimeline } from '../../../actions/timelines';
|
||||||
import { getSettings } from 'soapbox/actions/settings';
|
import { getSettings } from 'soapbox/actions/settings';
|
||||||
import { shouldFilter } from 'soapbox/utils/timelines';
|
import { shouldFilter } from 'soapbox/utils/timelines';
|
||||||
|
|
||||||
|
let lastStatusId;
|
||||||
|
|
||||||
const makeGetStatusIds = () => createSelector([
|
const makeGetStatusIds = () => createSelector([
|
||||||
(state, { type }) => getSettings(state).get(type, ImmutableMap()),
|
(state, { type }) => getSettings(state).get(type, ImmutableMap()),
|
||||||
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),
|
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),
|
||||||
(state) => state.get('statuses'),
|
(state) => state.get('statuses'),
|
||||||
(state) => state.get('me'),
|
(state) => state.get('me'),
|
||||||
], (columnSettings, statusIds, statuses, me) => {
|
], (columnSettings, statusIds, statuses, me) => {
|
||||||
|
lastStatusId = statusIds.last();
|
||||||
return statusIds.filter(id => {
|
return statusIds.filter(id => {
|
||||||
const status = statuses.get(id);
|
const status = statuses.get(id);
|
||||||
if (!status) return true;
|
if (!status) return true;
|
||||||
|
@ -26,6 +29,7 @@ const mapStateToProps = (state, { timelineId }) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
statusIds: getStatusIds(state, { type: timelineId }),
|
statusIds: getStatusIds(state, { type: timelineId }),
|
||||||
|
lastStatusId: lastStatusId,
|
||||||
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
||||||
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
||||||
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
||||||
|
|
Loading…
Reference in a new issue