Updated on 2026-08-14

This commit is contained in:
Tangem 2024-10-01 08:56:26 +03:00
parent 480b488bf8
commit f5d62ce062

View file

@ -149,20 +149,19 @@ internal class TokenDetailsLoadedBalanceConverter(
val fiatRate = status.value.fiatRate
return when {
stakingCryptoAmount.isNullOrZero() && stakingEntryInfo != null -> {
if (pendingBalances.isEmpty()) {
getStakeAvailableState(stakingEntryInfo, iconState)
} else {
val pendingBalancesCryptoAmount = pendingBalances.sumOf { it.amount }
stakingCryptoAmount.isNullOrZero() && stakingEntryInfo != null && pendingBalances.isEmpty() -> {
getStakeAvailableState(stakingEntryInfo, iconState)
}
stakingCryptoAmount.isNullOrZero() && stakingEntryInfo != null && pendingBalances.isNotEmpty() -> {
val pendingBalancesCryptoAmount = pendingBalances.sumOf { it.amount }
val stakingFiatAmount = fiatRate?.multiply(pendingBalancesCryptoAmount)
getStakedState(
status = status,
stakingCryptoAmount = pendingBalancesCryptoAmount,
stakingFiatAmount = stakingFiatAmount,
stakingRewardAmount = null,
)
}
val stakingFiatAmount = fiatRate?.multiply(pendingBalancesCryptoAmount)
getStakedState(
status = status,
stakingCryptoAmount = pendingBalancesCryptoAmount,
stakingFiatAmount = stakingFiatAmount,
stakingRewardAmount = null,
)
}
stakingCryptoAmount.isNullOrZero() && stakingEntryInfo == null -> {
StakingBlockUM.Error(iconState = iconState)