Updated on 2026-08-14
This commit is contained in:
parent
448a472832
commit
f22fbb88e5
2 changed files with 13 additions and 3 deletions
|
|
@ -26,6 +26,10 @@ class YieldSupplyGetRewardsBalanceUseCase(
|
|||
val cryptoAmount = status.value.amount
|
||||
val fiatRate = status.value.fiatRate
|
||||
|
||||
if (cryptoAmount?.compareTo(BigDecimal.ZERO) == 0) {
|
||||
return@flow
|
||||
}
|
||||
|
||||
val amount = if (cryptoAmount != null && fiatRate != null) {
|
||||
cryptoAmount.multiply(fiatRate)
|
||||
} else {
|
||||
|
|
@ -95,7 +99,7 @@ class YieldSupplyGetRewardsBalanceUseCase(
|
|||
private const val SCALE = 18
|
||||
|
||||
private const val MIN_DECIMALS = 3
|
||||
private const val MAX_DECIMALS = 8
|
||||
private const val MAX_DECIMALS = 12
|
||||
|
||||
private val LN_10 = ln(10.0)
|
||||
private const val EPSILON = 1e-18
|
||||
|
|
|
|||
|
|
@ -1251,8 +1251,14 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleNavigationParam() {
|
||||
if (params.navigationAction is NavigationAction.Staking) {
|
||||
openStaking()
|
||||
when (val action = params.navigationAction) {
|
||||
is NavigationAction.Staking -> openStaking()
|
||||
is NavigationAction.YieldSupply -> if (action.isActive) {
|
||||
modelScope.launch(dispatchers.default) {
|
||||
fetchCurrencyStatusUseCase(userWalletId = userWalletId, id = cryptoCurrency.id)
|
||||
}
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue