From 9f3d8e05a58782eb33cdf0d61406f4a19a64d153 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 Nov 2023 10:13:12 -0600 Subject: [PATCH] Use flatmap --- src/view/com/auth/onboarding/RecommendedFollows.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/view/com/auth/onboarding/RecommendedFollows.tsx b/src/view/com/auth/onboarding/RecommendedFollows.tsx index 3b46516c9f..9f195a3666 100644 --- a/src/view/com/auth/onboarding/RecommendedFollows.tsx +++ b/src/view/com/auth/onboarding/RecommendedFollows.tsx @@ -92,13 +92,7 @@ export const RecommendedFollows = observer(function RecommendedFollowsImpl({ if (!suggestedFollows) return [] const additional = Object.entries(additionalSuggestions) - const items = [] - - for (const page of suggestedFollows.pages) { - for (const actor of page.actors) { - items.push(actor) - } - } + const items = suggestedFollows.pages.flatMap(page => page.actors) outer: while (additional.length) { const additionalAccount = additional.shift()