From a4615296e80aba2c5b9e764cc22a9939890242ad Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 23 Dec 2022 12:20:11 -0600 Subject: [PATCH] Make all timelines use "home" timeline settings Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1230 --- app/soapbox/features/community-timeline/index.tsx | 1 + app/soapbox/features/preferences/index.tsx | 10 ++-------- app/soapbox/features/public-timeline/index.tsx | 1 + app/soapbox/features/ui/components/timeline.tsx | 5 ++++- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/soapbox/features/community-timeline/index.tsx b/app/soapbox/features/community-timeline/index.tsx index a5c2a17fa8..3fca53cc59 100644 --- a/app/soapbox/features/community-timeline/index.tsx +++ b/app/soapbox/features/community-timeline/index.tsx @@ -45,6 +45,7 @@ const CommunityTimeline = () => { } divideType='space' diff --git a/app/soapbox/features/preferences/index.tsx b/app/soapbox/features/preferences/index.tsx index 6c620adb15..ebfd025470 100644 --- a/app/soapbox/features/preferences/index.tsx +++ b/app/soapbox/features/preferences/index.tsx @@ -121,17 +121,11 @@ const Preferences = () => { return (
- } - hint={} - > + }> - } - hint={} - > + }> diff --git a/app/soapbox/features/public-timeline/index.tsx b/app/soapbox/features/public-timeline/index.tsx index 1bcd534a53..b62c5495cb 100644 --- a/app/soapbox/features/public-timeline/index.tsx +++ b/app/soapbox/features/public-timeline/index.tsx @@ -92,6 +92,7 @@ const CommunityTimeline = () => { } divideType='space' diff --git a/app/soapbox/features/ui/components/timeline.tsx b/app/soapbox/features/ui/components/timeline.tsx index 3b5e71f817..523b7d79af 100644 --- a/app/soapbox/features/ui/components/timeline.tsx +++ b/app/soapbox/features/ui/components/timeline.tsx @@ -16,19 +16,22 @@ const messages = defineMessages({ interface ITimeline extends Omit { /** ID of the timeline in Redux. */ timelineId: string, + /** Settings path to use instead of the timelineId. */ + prefix?: string, } /** Scrollable list of statuses from a timeline in the Redux store. */ const Timeline: React.FC = ({ timelineId, onLoadMore, + prefix, ...rest }) => { const dispatch = useAppDispatch(); const getStatusIds = useCallback(makeGetStatusIds(), []); const lastStatusId = useAppSelector(state => (state.timelines.get(timelineId)?.items || ImmutableOrderedSet()).last() as string | undefined); - const statusIds = useAppSelector(state => getStatusIds(state, { type: timelineId })); + const statusIds = useAppSelector(state => getStatusIds(state, { type: timelineId, prefix })); const isLoading = useAppSelector(state => (state.timelines.get(timelineId) || { isLoading: true }).isLoading === true); const isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true); const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);