[Glitch] Fix timeline unable to load more when the last item is a inline-follow-suggestions

Port cf41960f64 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Sharlayan authored and Claire committed 2026-07-10 18:03:27 +02:00
1 parent dfd18b34f0
commit f6456e4943
2 files changed
+3 -3

No files matched your search

@@ -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 'flavours/glitch/actions/timelines';
import { isNonStatusId } from 'flavours/glitch/actions/timelines_typed';
import { RegenerationIndicator } from 'flavours/glitch/components/regeneration_indicator';
import { InlineFollowSuggestions } from 'flavours/glitch/features/home_timeline/components/inline_follow_suggestions';
import { PinnedShowAllButton } from '@/flavours/glitch/features/account_timeline/components/pinned_statuses';
@@ -46,7 +47,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 => {
@@ -82,8 +82,7 @@ const makeMapStateToProps = () => {
*/
const mapStateToProps = (state, { timelineId, regex, initialLoadingState = true, maxItems }) => ({
statusIds: getStatusIds(state, { type: timelineId, regex, 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']),