Merge branch 'home-link-headers' into 'develop'
Use Link header for home timeline pagination See merge request soapbox-pub/soapbox!2395
This commit is contained in:
@ -30,7 +30,7 @@ const CarouselItem = React.forwardRef((
|
||||
setLoading(true);
|
||||
|
||||
if (isSelected) {
|
||||
dispatch(replaceHomeTimeline(null, { maxId: null }, () => setLoading(false)));
|
||||
dispatch(replaceHomeTimeline(undefined, { maxId: null }, () => setLoading(false)));
|
||||
|
||||
if (onPinned) {
|
||||
onPinned(null);
|
||||
|
||||
@ -27,9 +27,10 @@ const HomeTimeline: React.FC = () => {
|
||||
const isPartial = useAppSelector(state => state.timelines.get('home')?.isPartial === true);
|
||||
const currentAccountId = useAppSelector(state => state.timelines.get('home')?.feedAccountId as string | undefined);
|
||||
const currentAccountRelationship = useAppSelector(state => currentAccountId ? state.relationships.get(currentAccountId) : null);
|
||||
const next = useAppSelector(state => state.timelines.get('home')?.next);
|
||||
|
||||
const handleLoadMore = (maxId: string) => {
|
||||
dispatch(expandHomeTimeline({ maxId, accountId: currentAccountId }));
|
||||
dispatch(expandHomeTimeline({ url: next, maxId, accountId: currentAccountId }));
|
||||
};
|
||||
|
||||
// Mastodon generates the feed in Redis, and can return a partial timeline
|
||||
@ -52,7 +53,7 @@ const HomeTimeline: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleRefresh = () => {
|
||||
return dispatch(expandHomeTimeline({ maxId: null, accountId: currentAccountId }));
|
||||
return dispatch(expandHomeTimeline({ accountId: currentAccountId }));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -35,7 +35,7 @@ const TestTimeline: React.FC = () => {
|
||||
|
||||
React.useEffect(() => {
|
||||
dispatch(importFetchedStatuses(MOCK_STATUSES));
|
||||
dispatch(expandTimelineSuccess(timelineId, MOCK_STATUSES, null, false, false, false));
|
||||
dispatch(expandTimelineSuccess(timelineId, MOCK_STATUSES, undefined, undefined, false, false, false));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user