From ca833e5eedbc53e40714c1cfcaadd3fe9018abf3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 13 Jul 2022 19:15:39 -0500 Subject: [PATCH] Revert "Timeline: don't try to memoize getStatusIds" This reverts commit dd58f8fce7a10dd5e128b5e7c6754ffe84a61dbd. --- app/soapbox/features/ui/components/timeline.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/soapbox/features/ui/components/timeline.tsx b/app/soapbox/features/ui/components/timeline.tsx index 41b312ad3..53d1ad7f8 100644 --- a/app/soapbox/features/ui/components/timeline.tsx +++ b/app/soapbox/features/ui/components/timeline.tsx @@ -9,8 +9,6 @@ import StatusList, { IStatusList } from 'soapbox/components/status_list'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import { makeGetStatusIds } from 'soapbox/selectors'; -const getStatusIds = makeGetStatusIds(); - const messages = defineMessages({ queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' }, }); @@ -27,6 +25,7 @@ const Timeline: React.FC = ({ ...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 }));