Updated on 2026-08-14
This commit is contained in:
parent
bcd10fbe27
commit
7647ef2ee8
3 changed files with 5 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ internal class AmountChangeStateTransformer(
|
|||
return prevState.copy(
|
||||
amountState = AmountRequirementStateTransformer(
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
maxAmount = maxEnterAmount,
|
||||
yield = yield,
|
||||
actionType = prevState.actionType,
|
||||
).transform(updatedAmountState),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ internal class AmountMaxValueStateTransformer(
|
|||
).transform(prevState.amountState)
|
||||
return prevState.copy(
|
||||
amountState = AmountRequirementStateTransformer(
|
||||
maxAmount = maxEnterAmount,
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
yield = yield,
|
||||
actionType = prevState.actionType,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import androidx.annotation.StringRes
|
|||
import androidx.compose.ui.text.input.ImeAction
|
||||
import com.tangem.common.extensions.isZero
|
||||
import com.tangem.common.ui.amountScreen.models.AmountState
|
||||
import com.tangem.common.ui.amountScreen.models.EnterAmountBoundary
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
|
|
@ -24,6 +25,7 @@ import java.math.RoundingMode
|
|||
|
||||
internal class AmountRequirementStateTransformer(
|
||||
private val cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
private val maxAmount: EnterAmountBoundary,
|
||||
private val yield: Yield,
|
||||
private val actionType: StakingActionCommonType,
|
||||
) : Transformer<AmountState> {
|
||||
|
|
@ -121,7 +123,7 @@ internal class AmountRequirementStateTransformer(
|
|||
val isExceedsMaxRequirement = if (maximum?.isPositive() == true) {
|
||||
maximum?.compareTo(amount) == -1
|
||||
} else {
|
||||
cryptoCurrencyStatus.value.amount?.compareTo(amount) == -1
|
||||
maxAmount.amount?.compareTo(amount) == -1
|
||||
}
|
||||
|
||||
val errorText = when {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue