diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/fields/SimpleTextField.kt b/core/ui/src/main/java/com/tangem/core/ui/components/fields/SimpleTextField.kt index ed91b52667..b9cba56550 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/fields/SimpleTextField.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/fields/SimpleTextField.kt @@ -72,14 +72,12 @@ fun SimpleTextField( } var lastTextValue by remember(value) { - derivedStateOf { - val isSelectionLastIndex = textFieldValueState.selection.end == textFieldValueState.text.lastIndex - if (textFieldValueState.text.isBlank() || isSelectionLastIndex) { - textFieldValueState = textFieldValueState.copy( - text = value, - selection = getValueRange(value), - ) - } + val isSelectionLastIndex = textFieldValueState.selection.end == textFieldValueState.text.lastIndex + if (textFieldValueState.text.isBlank() || isSelectionLastIndex) { + textFieldValueState = textFieldValueState.copy( + text = value, + selection = getValueRange(value), + ) } mutableStateOf(value) } diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt index fb65e2a8b5..68d334e0ae 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt @@ -59,7 +59,6 @@ internal class SendNotificationFactory( // errors addExceedBalanceNotification(feeAmount, amountValue) addExceedsBalanceNotification(feeState.fee) - addInvalidAmountNotification(sendState.isSubtract, amountValue) addMinimumAmountErrorNotification(feeAmount, amountValue) addDustWarningNotification(feeAmount, amountValue) addTransactionLimitErrorNotification(feeAmount, amountValue) @@ -106,15 +105,6 @@ internal class SendNotificationFactory( } } - private fun MutableList.addInvalidAmountNotification( - isSubtractAmount: Boolean, - receivedAmount: BigDecimal, - ) { - if (isSubtractAmount && receivedAmount <= BigDecimal.ZERO) { - add(SendNotification.Error.InvalidAmount) - } - } - private fun MutableList.addMinimumAmountErrorNotification( feeAmount: BigDecimal, receivedAmount: BigDecimal, @@ -227,7 +217,7 @@ internal class SendNotificationFactory( val balance = cryptoCurrencyStatus.value.amount ?: BigDecimal.ZERO val isTezos = cryptoCurrencyStatus.currency.network.id.value == Blockchain.Tezos.id val threshold = Blockchain.Tezos.minimalAmount() - val isTotalBalance = feeAmount.plus(sendAmount) >= balance + val isTotalBalance = feeAmount.plus(sendAmount) >= balance && balance > threshold if (!ignoreAmountReduce && isTotalBalance && isTezos) { add( SendNotification.Warning.HighFeeError(