From cf41960f64e34b8b00fc464b531fd5a29ca9485a Mon Sep 17 00:00:00 2001 From: Sharlayan <118798881+sharlayan@users.noreply.github.com> Date: Fri, 10 Jul 2026 21:58:52 +0900 Subject: [PATCH] Fix timeline unable to load more when the last item is a `inline-follow-suggestions` (#39773) --- app/javascript/mastodon/components/status_list.jsx | 3 ++- .../mastodon/features/ui/containers/status_list_container.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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']),