always add vaultConfigs to HC (#408)

This commit is contained in:
Bob van der Helm 2023-08-30 08:43:53 -03:00 committed by GitHub
parent 1923b8e7d7
commit 27138f0176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,19 +96,16 @@ export default function useHealthComputer(account?: Account) {
)
const vaultConfigsData = useMemo(() => {
if (!positions || !vaultConfigs.length) return null
if (!vaultConfigs.length) return null
const vaultPositionDenoms = positions.vaults.map((vault) => vault.vault.address)
return vaultConfigs
.filter((config) => vaultPositionDenoms.includes(config.addr))
.reduce(
(prev, curr) => {
prev[curr.addr] = curr
return prev
},
{} as { [key: string]: VaultConfigBaseForString },
)
}, [vaultConfigs, positions])
return vaultConfigs.reduce(
(prev, curr) => {
prev[curr.addr] = curr
return prev
},
{} as { [key: string]: VaultConfigBaseForString },
)
}, [vaultConfigs])
const healthComputer: HealthComputer | null = useMemo(() => {
if (