mirror of
https://github.com/mastodon/mastodon.git
synced 2026-08-19 23:55:45 -05:00
Fix timeline unable to load more when the last item is a inline-follow-suggestions (#39773)
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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']),
|
||||
|
||||
Reference in New Issue
Block a user