Fix timeline unable to load more when the last item is a inline-follow-suggestions (#39773)

This commit is contained in:
Sharlayan
2026-07-10 21:58:52 +09:00
committed by GitHub
parent 4c69ecb13d
commit cf41960f64
2 changed files with 3 additions and 2 deletions

View File

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

View File

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