diff --git a/app/javascript/mastodon/components/status_list.jsx b/app/javascript/mastodon/components/status_list.jsx index 5e2c960ed15..a0ef4fffce4 100644 --- a/app/javascript/mastodon/components/status_list.jsx +++ b/app/javascript/mastodon/components/status_list.jsx @@ -6,6 +6,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { debounce } from 'lodash'; import { TIMELINE_GAP, TIMELINE_PINNED_VIEW_ALL, TIMELINE_SUGGESTIONS } from 'mastodon/actions/timelines'; +import { isNonStatusId } from 'mastodon/actions/timelines_typed'; import { RegenerationIndicator } from 'mastodon/components/regeneration_indicator'; import { InlineFollowSuggestions } from 'mastodon/features/home_timeline/components/inline_follow_suggestions'; import { PinnedShowAllButton } from '@/mastodon/features/account_timeline/components/pinned_statuses'; @@ -45,7 +46,7 @@ export default class StatusList extends ImmutablePureComponent { handleLoadOlder = debounce(() => { const { statusIds, lastId, onLoadMore } = this.props; - onLoadMore(lastId || (statusIds.size > 0 ? statusIds.last() : undefined)); + onLoadMore(lastId || statusIds.findLast(id => !isNonStatusId(id))); }, 300, { leading: true }); setRef = c => { diff --git a/app/javascript/mastodon/features/ui/containers/status_list_container.js b/app/javascript/mastodon/features/ui/containers/status_list_container.js index 8abbbefe146..64fd0422fae 100644 --- a/app/javascript/mastodon/features/ui/containers/status_list_container.js +++ b/app/javascript/mastodon/features/ui/containers/status_list_container.js @@ -58,7 +58,7 @@ const makeMapStateToProps = () => { */ const mapStateToProps = (state, { timelineId, initialLoadingState = true, maxItems }) => ({ statusIds: getStatusIds(state, { type: timelineId, maxItems }), - lastId: state.getIn(['timelines', timelineId, 'items'])?.last(), + lastId: state.getIn(['timelines', timelineId, 'items'])?.findLast(id => !isNonStatusId(id)), isLoading: state.getIn(['timelines', timelineId, 'isLoading'], initialLoadingState), isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false), hasMore: state.getIn(['timelines', timelineId, 'hasMore']),