always add vaultConfigs to HC (#408)
This commit is contained in:
parent
1923b8e7d7
commit
27138f0176
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user