fix: duplicated icons in list
This commit is contained in:
parent
1bf5fdeaca
commit
35b3c5b965
@ -39,12 +39,11 @@ const fuseOptions = {
|
|||||||
const fuse = new Fuse(iconNames, fuseOptions)
|
const fuse = new Fuse(iconNames, fuseOptions)
|
||||||
|
|
||||||
const findIconsInLibrary = (icon: string): string[] => {
|
const findIconsInLibrary = (icon: string): string[] => {
|
||||||
return fuse
|
const results = fuse.search(icon).map((result) => {
|
||||||
.search(icon)
|
|
||||||
.map((result) => {
|
|
||||||
return result.item
|
return result.item
|
||||||
})
|
})
|
||||||
.slice(0, 50)
|
const uniqueResults = Array.from(new Set(results))
|
||||||
|
return uniqueResults.slice(0, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IconSelectorModal: React.FC<IconSelectorModalProps> = ({
|
export const IconSelectorModal: React.FC<IconSelectorModalProps> = ({
|
||||||
|
Reference in New Issue
Block a user