Handle duplicate keys for bookmarks

Closes #1445

Co-Authored-By: David <davidsmejia@gmail.com>
pull/1455/head
shamoon 2 years ago
parent dcb9d9e45c
commit 442a76a57e

@ -4,7 +4,7 @@ export default function List({ bookmarks }) {
return (
<ul className="mt-3 flex flex-col">
{bookmarks.map((bookmark) => (
<Item key={bookmark.name} bookmark={bookmark} />
<Item key={`${bookmark.name}-${bookmark.href}`} bookmark={bookmark} />
))}
</ul>
);

@ -161,7 +161,7 @@ export default function QuickLaunch({servicesAndBookmarks, searchString, setSear
)} type="text" autoCorrect="false" ref={searchField} value={searchString} onChange={handleSearchChange} onKeyDown={handleSearchKeyDown} />
{results.length > 0 && <ul className="max-h-[60vh] overflow-y-auto m-2">
{results.map((r, i) => (
<li key={r.container ?? r.app ?? r.name}>
<li key={r.container ?? r.app ?? `${r.name}-${r.href}`}>
<button type="button" data-index={i} onMouseEnter={handleItemHover} className={classNames(
"flex flex-row w-full items-center justify-between rounded-md text-sm md:text-xl py-2 px-4 cursor-pointer text-theme-700 dark:text-theme-200",
i === currentItemIndex && "bg-theme-300/50 dark:bg-theme-700/50",

Loading…
Cancel
Save