Skip to content

Commit

Permalink
Fix: remove dynamic sorting for safe lists (#3397)
Browse files Browse the repository at this point in the history
* remove dynamic sorting by current chain for safe lists

* fix: useMemo dependency array

* fix: remove unused variable
  • Loading branch information
jmealy authored Mar 6, 2024
1 parent 2f9073c commit 63e243e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/welcome/MyAccounts/useAllSafes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useAppSelector } from '@/store'
import { selectAllAddedSafes } from '@/store/addedSafesSlice'
import useAllOwnedSafes from './useAllOwnedSafes'
import useChains from '@/hooks/useChains'
import useChainId from '@/hooks/useChainId'
import useWallet from '@/hooks/wallets/useWallet'
import { selectUndeployedSafes } from '@/store/slices'
import { sameAddress } from '@/utils/addresses'
Expand Down Expand Up @@ -41,11 +40,10 @@ const useAllSafes = (): SafeItems => {
const [allOwned = {}] = useAllOwnedSafes(walletAddress)
const allAdded = useAddedSafes()
const { configs } = useChains()
const currentChainId = useChainId()
const undeployedSafes = useAppSelector(selectUndeployedSafes)

return useMemo<SafeItems>(() => {
const chains = uniq([currentChainId].concat(Object.keys(allAdded)).concat(Object.keys(allOwned)))
const chains = uniq(Object.keys(allAdded).concat(Object.keys(allOwned)))

return chains.flatMap((chainId) => {
if (!configs.some((item) => item.chainId === chainId)) return []
Expand All @@ -68,7 +66,7 @@ const useAllSafes = (): SafeItems => {
}
})
})
}, [currentChainId, allAdded, allOwned, configs, undeployedSafes, walletAddress])
}, [allAdded, allOwned, configs, undeployedSafes, walletAddress])
}

export default useAllSafes

0 comments on commit 63e243e

Please sign in to comment.