v2.0.2 hotfix (#604)

* fix: if HF > 1 and Health === 0 -> return health = 1

* fix: don’t return undefined
This commit is contained in:
Linkie Link 2023-10-30 21:27:09 +01:00 committed by GitHub
parent c0893b8061
commit fb10397e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,6 +189,7 @@ export default function useHealthComputer(account?: Account) {
.toNumber() .toNumber()
if (convertedHealth > 100) return 100 if (convertedHealth > 100) return 100
if (convertedHealth === 0 && healthFactor > 1) return 1
if (convertedHealth < 0) return 0 if (convertedHealth < 0) return 0
return convertedHealth return convertedHealth
}, [healthFactor]) }, [healthFactor])