Skip to content

Commit

Permalink
fix: ensure unique keys for search items (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
lainbo authored Sep 19, 2024
1 parent 18e0353 commit 6c6b082
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/renderer/src/modules/panel/cmdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const SearchCmdK: React.FC = () => {
const feed = getFeedById(entry.feedId)
return (
<SearchItem
key={entry.item.id}
key={`entry-${entry.item.id}-${entry.feedId}`}
view={feed?.id ? getSubscriptionByFeedId(feed.id)?.view : undefined}
title={entry.item.title!}
feedId={entry.feedId}
Expand All @@ -191,7 +191,7 @@ export const SearchCmdK: React.FC = () => {
>
{renderedFeeds.map((feed) => (
<SearchItem
key={feed.item.id}
key={`feed-${feed.item.id}`}
view={getSubscriptionByFeedId(feed.item.id!)?.view}
title={feed.item.title!}
feedId={feed.item.id!}
Expand Down Expand Up @@ -246,7 +246,8 @@ const SearchItem = memo(function Item({
"min-w-0 max-w-full",
styles["content-visually"],
)}
key={id}
key={`${id}-${feedId}-${entryId}`}
id={`${id}-${feedId}-${entryId}`}
onSelect={() => {
navigateEntry({
feedId: feedId!,
Expand Down

0 comments on commit 6c6b082

Please sign in to comment.