about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-17 11:34:27 -0600
committerGitHub <noreply@github.com>2023-11-17 11:34:27 -0600
commit0dfc039a471d76c42610abe2c497fdf0c4785585 (patch)
tree55f0eb60fb2a59a6f3f09fa95adb611a8bebbce5 /src
parentc858b583072d7858f50ee0d56bb76dbce5a9c13d (diff)
downloadvoidsky-0dfc039a471d76c42610abe2c497fdf0c4785585.tar.zst
Fix some key errors (#1951)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/lists/ProfileLists.tsx7
-rw-r--r--src/view/screens/Search/Search.tsx8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx
index ed42a2607..692891e47 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 54e042d04..6674d7cd1 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())
     }