1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00

fix: duplicated icons in list

This commit is contained in:
Xc165543337 2024-05-22 19:18:54 +02:00
parent 1bf5fdeaca
commit 35b3c5b965

View File

@ -39,12 +39,11 @@ const fuseOptions = {
const fuse = new Fuse(iconNames, fuseOptions)
const findIconsInLibrary = (icon: string): string[] => {
return fuse
.search(icon)
.map((result) => {
return result.item
})
.slice(0, 50)
const results = fuse.search(icon).map((result) => {
return result.item
})
const uniqueResults = Array.from(new Set(results))
return uniqueResults.slice(0, 50)
}
export const IconSelectorModal: React.FC<IconSelectorModalProps> = ({