Use flatmap
This commit is contained in:
@@ -92,13 +92,7 @@ export const RecommendedFollows = observer(function RecommendedFollowsImpl({
|
|||||||
if (!suggestedFollows) return []
|
if (!suggestedFollows) return []
|
||||||
|
|
||||||
const additional = Object.entries(additionalSuggestions)
|
const additional = Object.entries(additionalSuggestions)
|
||||||
const items = []
|
const items = suggestedFollows.pages.flatMap(page => page.actors)
|
||||||
|
|
||||||
for (const page of suggestedFollows.pages) {
|
|
||||||
for (const actor of page.actors) {
|
|
||||||
items.push(actor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
outer: while (additional.length) {
|
outer: while (additional.length) {
|
||||||
const additionalAccount = additional.shift()
|
const additionalAccount = additional.shift()
|
||||||
|
|||||||
Reference in New Issue
Block a user