From 0dfc039a471d76c42610abe2c497fdf0c4785585 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 17 Nov 2023 11:34:27 -0600 Subject: [PATCH] Fix some key errors (#1951) --- src/view/com/lists/ProfileLists.tsx | 7 ++++++- src/view/screens/Search/Search.tsx | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx index ed42a260..692891e4 100644 --- a/src/view/com/lists/ProfileLists.tsx +++ b/src/view/com/lists/ProfileLists.tsx @@ -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( + page.lists.map(l => ({ + ...l, + _reactKey: l.uri, + })), + ) } } if (isError && !isEmpty) { diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 54e042d0..6674d7cd 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -137,11 +137,11 @@ function SearchScreenSuggestedFollows() { ), ) ).flat() - - setSuggestions( - // 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, ) + + setSuggestions(deduped) setDataUpdatedAt(Date.now()) }