From 06d1ad2efed8376448880927d2e69fca03cfeebf Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 10 Aug 2022 11:33:23 -0400 Subject: [PATCH] Remove sort --- app/soapbox/features/ui/components/trends-panel.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/soapbox/features/ui/components/trends-panel.tsx b/app/soapbox/features/ui/components/trends-panel.tsx index ee0d8d763..9f582d891 100644 --- a/app/soapbox/features/ui/components/trends-panel.tsx +++ b/app/soapbox/features/ui/components/trends-panel.tsx @@ -12,21 +12,13 @@ interface ITrendsPanel { const TrendsPanel = ({ limit }: ITrendsPanel) => { const { data: trends, isFetching } = useTrends(); - const sortedTrends = React.useMemo(() => { - return trends?.sort((a, b) => { - const num_a = Number(a.getIn(['history', 0, 'accounts'])); - const num_b = Number(b.getIn(['history', 0, 'accounts'])); - return num_b - num_a; - }).slice(0, limit); - }, [trends, limit]); - if (trends?.length === 0 || isFetching) { return null; } return ( }> - {sortedTrends?.slice(0, limit).map((hashtag) => ( + {trends?.slice(0, limit).map((hashtag) => ( ))}