Use flatmap

This commit is contained in:
Eric Bailey
2023-11-14 10:13:12 -06:00
parent 2221f726b7
commit 9f3d8e05a5
@@ -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()