diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-12-27 08:49:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 08:49:39 -0800 |
commit | 8b6ecf6bfff0a18e92a172004cd37fe2aacaf37f (patch) | |
tree | 4ee431b5c96c1cb3c9e02288b8ad48c2736d6a3a /src/view | |
parent | 0c9dc2163ab5102e58f13597ba84e14717e09ffd (diff) | |
download | voidsky-8b6ecf6bfff0a18e92a172004cd37fe2aacaf37f.tar.zst |
* Fix duplicate react keys in post search * Protect against duplicate react keys in feeds
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/screens/Search/Search.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 60fd21674..b522edfba 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -212,12 +212,17 @@ function SearchScreenPostResults({query}: {query: string}) { const items = React.useMemo(() => { let temp: SearchResultSlice[] = [] + const seenUris = new Set() for (const post of posts) { + if (seenUris.has(post.uri)) { + continue + } temp.push({ type: 'post', key: post.uri, post, }) + seenUris.add(post.uri) } if (isFetchingNextPage) { |