Updated on 2026-08-14
This commit is contained in:
commit
375df6ef6e
2 changed files with 7 additions and 19 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<SendNotification>.addInvalidAmountNotification(
|
||||
isSubtractAmount: Boolean,
|
||||
receivedAmount: BigDecimal,
|
||||
) {
|
||||
if (isSubtractAmount && receivedAmount <= BigDecimal.ZERO) {
|
||||
add(SendNotification.Error.InvalidAmount)
|
||||
}
|
||||
}
|
||||
|
||||
private fun MutableList<SendNotification>.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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue