From 3e3ad4ef457c1faa555b1b47a292cb8885ef513c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sun, 2 Nov 2025 11:52:19 +0100 Subject: [PATCH] pl-fe: isLoadingRecent was unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/actions/timelines.ts | 25 ++++++++----------- .../src/pages/timelines/test-timeline.tsx | 2 +- packages/pl-fe/src/reducers/timelines.ts | 4 +-- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/packages/pl-fe/src/actions/timelines.ts b/packages/pl-fe/src/actions/timelines.ts index 8457e93e6..5d8ec937c 100644 --- a/packages/pl-fe/src/actions/timelines.ts +++ b/packages/pl-fe/src/actions/timelines.ts @@ -159,7 +159,7 @@ const deduplicateStatuses = (statuses: Array) => { return deduplicatedStatuses; }; -const handleTimelineExpand = (timelineId: string, fn: Promise>, isLoadingRecent: boolean, done = noOp, onError?: (error: any) => void) => +const handleTimelineExpand = (timelineId: string, fn: Promise>, done = noOp, onError?: (error: any) => void) => (dispatch: AppDispatch) => { dispatch(expandTimelineRequest(timelineId)); @@ -175,7 +175,6 @@ const handleTimelineExpand = (timelineId: string, fn: Promise { @@ -196,7 +195,7 @@ const fetchHomeTimeline = (expand = false, done = noOp) => const fn = (expand && state.timelines.home?.next?.()) || getClient(state).timelines.homeTimeline(params); - return dispatch(handleTimelineExpand('home', fn, false, done)); + return dispatch(handleTimelineExpand('home', fn, done)); }; const fetchPublicTimeline = ({ onlyMedia, local, instance }: Record = {}, expand = false, done = noOp, onError = noOp) => @@ -211,7 +210,7 @@ const fetchPublicTimeline = ({ onlyMedia, local, instance }: Record const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.publicTimeline(params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done, onError)); + return dispatch(handleTimelineExpand(timelineId, fn, done, onError)); }; const fetchBubbleTimeline = ({ onlyMedia }: Record = {}, expand = false, done = noOp) => @@ -226,7 +225,7 @@ const fetchBubbleTimeline = ({ onlyMedia }: Record = {}, expand = f const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.bubbleTimeline(params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchWrenchedTimeline = ({ onlyMedia }: Record = {}, expand = false, done = noOp) => @@ -241,7 +240,7 @@ const fetchWrenchedTimeline = ({ onlyMedia }: Record = {}, expand = const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.wrenchedTimeline(params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchAccountTimeline = (accountId: string, { exclude_replies, pinned, only_media, limit }: Record = {}, expand = false, done = noOp) => @@ -258,7 +257,7 @@ const fetchAccountTimeline = (accountId: string, { exclude_replies, pinned, only const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).accounts.getAccountStatuses(accountId, params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchListTimeline = (listId: string, expand = false, done = noOp) => @@ -273,7 +272,7 @@ const fetchListTimeline = (listId: string, expand = false, done = noOp) => const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.listTimeline(listId, params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchCircleTimeline = (circleId: string, expand = false, done = noOp) => @@ -288,7 +287,7 @@ const fetchCircleTimeline = (circleId: string, expand = false, done = noOp) => const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).circles.getCircleStatuses(circleId, params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchGroupTimeline = (groupId: string, { only_media, limit }: Record = {}, expand = false, done = noOp) => @@ -304,7 +303,7 @@ const fetchGroupTimeline = (groupId: string, { only_media, limit }: Record = {}, expand = false, done = noOp) => @@ -324,7 +323,7 @@ const fetchHashtagTimeline = (hashtag: string, { tags }: Record = { const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.hashtagTimeline(hashtag, params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const fetchLinkTimeline = (url: string, expand = false, done = noOp) => @@ -340,7 +339,7 @@ const fetchLinkTimeline = (url: string, expand = false, done = noOp) => const fn = (expand && state.timelines[timelineId]?.next?.()) || getClient(state).timelines.linkTimeline(url, params); - return dispatch(handleTimelineExpand(timelineId, fn, false, done)); + return dispatch(handleTimelineExpand(timelineId, fn, done)); }; const expandTimelineRequest = (timeline: string) => ({ @@ -354,7 +353,6 @@ const expandTimelineSuccess = ( next: (() => Promise>) | null, prev: (() => Promise>) | null, partial: boolean, - isLoadingRecent: boolean, ) => ({ type: TIMELINE_EXPAND_SUCCESS, timeline, @@ -362,7 +360,6 @@ const expandTimelineSuccess = ( next, prev, partial, - isLoadingRecent, }); const expandTimelineFail = (timeline: string, error: unknown) => ({ diff --git a/packages/pl-fe/src/pages/timelines/test-timeline.tsx b/packages/pl-fe/src/pages/timelines/test-timeline.tsx index 63765196c..b5a9e2029 100644 --- a/packages/pl-fe/src/pages/timelines/test-timeline.tsx +++ b/packages/pl-fe/src/pages/timelines/test-timeline.tsx @@ -32,7 +32,7 @@ const TestTimelinePage: React.FC = () => { React.useEffect(() => { dispatch(importEntities({ statuses: MOCK_STATUSES })); - dispatch(expandTimelineSuccess(timelineId, MOCK_STATUSES, null, null, false, false)); + dispatch(expandTimelineSuccess(timelineId, MOCK_STATUSES, null, null, false)); }, []); return ( diff --git a/packages/pl-fe/src/reducers/timelines.ts b/packages/pl-fe/src/reducers/timelines.ts index 017eefb06..b14594ebb 100644 --- a/packages/pl-fe/src/reducers/timelines.ts +++ b/packages/pl-fe/src/reducers/timelines.ts @@ -96,7 +96,6 @@ const expandNormalizedTimeline = ( next: (() => Promise>) | null, prev: (() => Promise>) | null, isPartial: boolean, - isLoadingRecent: boolean, pos: ImportPosition = 'end', ) => { const newIds = getStatusIds(statuses); @@ -109,7 +108,7 @@ const expandNormalizedTimeline = ( timeline.prev = prev; timeline.loaded = true; - if (!next && !isLoadingRecent) timeline.hasMore = false; + if (!next) timeline.hasMore = false; // Pinned timelines can be replaced entirely if (timelineId.endsWith(':pinned')) { @@ -325,7 +324,6 @@ const timelines = (state: State = initialState, action: AccountsAction | Interac action.next, action.prev, action.partial, - action.isLoadingRecent, )); case TIMELINE_UPDATE: return create(state, (draft) => appendStatus(draft, action.timeline, action.statusId));