fix leverage display on account summary

This commit is contained in:
saml33 2022-10-26 14:11:31 +11:00
parent 75653c2ed4
commit 555f5625eb
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ const MangoAccountSummary = () => {
const totalCollateral = mangoAccount
.getAssetsValue(group, HealthType.init)!
.toNumber()
return liabsValue / totalCollateral
if (isNaN(liabsValue / totalCollateral)) {
return 0
} else return liabsValue / totalCollateral
}, [mangoAccount])
return (