-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some key errors #1951
Fix some key errors #1951
Conversation
@@ -75,7 +75,12 @@ export function ProfileLists({ | |||
items = items.concat([EMPTY]) | |||
} else if (data?.pages) { | |||
for (const page of data?.pages) { | |||
items = items.concat(page.lists) | |||
items = items.concat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have other places needing a similar fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't noticed any yet, just grouped these fixes in a pr for now
// dedupe | ||
friendsOfFriends.filter(f => !friends.find(f2 => f.did === f2.did)), | ||
const deduped = friendsOfFriends.filter( | ||
(f, i) => friendsOfFriends.findIndex(f2 => f.did === f2.did) === i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do Array.from(new Set(friendsOfFriends))
to avoid loops inside a loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with objects, but we could probably do this faster by creating a Set(did, obj)
and reading values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool but let's fix nested loops too
Just gonna merge this and continue in a sep PR |
No description provided.