From 90222078f1138d4cb5e4ce49da10fbb487e04866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 20 Oct 2024 13:55:58 +0200 Subject: [PATCH] pl-fe: simplify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/features/ui/components/timeline.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/pl-fe/src/features/ui/components/timeline.tsx b/packages/pl-fe/src/features/ui/components/timeline.tsx index 9ce886b70..cd9e00bfc 100644 --- a/packages/pl-fe/src/features/ui/components/timeline.tsx +++ b/packages/pl-fe/src/features/ui/components/timeline.tsx @@ -1,4 +1,3 @@ -import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import debounce from 'lodash/debounce'; import React, { useCallback } from 'react'; import { defineMessages } from 'react-intl'; @@ -34,8 +33,8 @@ const Timeline: React.FC = ({ 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, prefix })); + const lastStatusId = statusIds.last(); 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);