Skip to content

Commit

Permalink
Switch to delegation tab when delegations change
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Jun 24, 2022
1 parent 1b565f0 commit c6acc2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ function Validators(props) {
const [filter, setFilter] = useState({keywords: '', status: 'active', group: 'delegated'})
const [results, setResults] = useState([])

useEffect(() => {
if(delegations && filter.group !== 'delegated'){
return setFilter({ ...filter, group: 'delegated' })
}
}, [Object.keys(delegations).length]);

useEffect(() => {
let filtered = filteredValidators(validators, filter)
let group = filter.group
Expand Down

0 comments on commit c6acc2a

Please sign in to comment.