mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix validation edge cases when applying payment request (#3063)
This commit is contained in:
@@ -687,6 +687,12 @@ class _NewSendPageState extends State<NewSendPage> {
|
||||
void _handleSend() async {
|
||||
//TODO refactor this action. code was copied over from old ui. i don't like it.
|
||||
|
||||
for(int i=0; i<widget.sendViewModel.outputs.length; i++) {
|
||||
if(i < _amountControllers.length) {
|
||||
widget.sendViewModel.outputs[i].cryptoAmount = _amountControllers[i].text;
|
||||
}
|
||||
}
|
||||
|
||||
if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
|
||||
if (widget.sendViewModel.outputs.length > 1) {
|
||||
showErrorValidationAlert(context);
|
||||
|
||||
@@ -70,6 +70,7 @@ class _NewSendAddressInputState extends State<NewSendAddressInput> {
|
||||
: EdgeInsets.zero,
|
||||
child: FormField<String>(
|
||||
key: formFieldKey,
|
||||
initialValue: widget.addressController.text,
|
||||
validator: widget.validator,
|
||||
builder: (state) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -39,6 +39,7 @@ class _NewSendAmountInputState extends State<NewSendAmountInput> {
|
||||
Widget build(BuildContext context) {
|
||||
return FormField<String>(
|
||||
key: formFieldKey,
|
||||
initialValue: widget.amountController.text,
|
||||
validator: widget.validator,
|
||||
builder: (state) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
Reference in New Issue
Block a user