Updated on 2026-08-14
This commit is contained in:
parent
8edf21d95b
commit
d6a43b3b62
5 changed files with 211 additions and 2 deletions
|
|
@ -12,7 +12,16 @@ internal class SendDestinationAddressTransformer(
|
|||
val state = prevState as? DestinationUM.Content ?: return prevState
|
||||
|
||||
return state.copy(
|
||||
addressTextField = state.addressTextField.copy(value = address, isValuePasted = isPasted),
|
||||
addressTextField = state.addressTextField.copy(
|
||||
value = address,
|
||||
isValuePasted = isPasted,
|
||||
// Editing the recipient invalidates any previously resolved/recognized data. It is
|
||||
// recomputed by the following validation; keeping it would let a stale canonical
|
||||
// address (blockchainAddress) leak into the transaction for the new, not-yet-validated value.
|
||||
blockchainAddress = null,
|
||||
contactName = null,
|
||||
contactIcon = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,9 @@ internal object SendDestinationValidationStartedTransformer : Transformer<Destin
|
|||
override fun transform(prevState: DestinationUM): DestinationUM {
|
||||
val state = prevState as? DestinationUM.Content ?: return prevState
|
||||
|
||||
return state.copy(isValidating = true)
|
||||
// Disable the primary button while validation is pending so it cannot be pressed with a
|
||||
// stale enablement carried over from the previously validated value. It is re-enabled by
|
||||
// SendDestinationValidationResultTransformer only when the new value is valid.
|
||||
return state.copy(isValidating = true, isPrimaryButtonEnabled = false)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue