Skip to content

Commit

Permalink
Verification plugin: Fix crashing chain selector
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelwedler committed Oct 28, 2024
1 parent 047855e commit 228587e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export const SearchableChainDropdown: React.FC<DropdownProps> = ({ label, id, se
})

useEffect(() => {
if (!isOpen) return
if (searchTerm === '') {
setFilteredOptions(dropdownChains)
} else {
const result = fuse.search(searchTerm)
setFilteredOptions(result.map(({ item }) => item))
}
}, [searchTerm, dropdownChains])
}, [searchTerm, dropdownChains, isOpen])

// Close dropdown when user clicks outside
useEffect(() => {
Expand Down

0 comments on commit 228587e

Please sign in to comment.