Commit 21c53d41 authored by dev0tion's avatar dev0tion

Improve send component error handling

parent dc3007c5
...@@ -26,7 +26,7 @@ export class SendComponent { ...@@ -26,7 +26,7 @@ export class SendComponent {
private buildSendForm(): void { private buildSendForm(): void {
this.sendForm = this.fb.group({ this.sendForm = this.fb.group({
"address": ["", Validators.required], "address": ["", Validators.required],
"amount": ["", Validators.required], "amount": ["", Validators.compose([Validators.required, Validators.pattern(/^[0-9]+(\.[0-9]{0,8})?$/)])],
"fee": [2, Validators.required], "fee": [2, Validators.required],
"password": ["", Validators.required] "password": ["", Validators.required]
}); });
...@@ -64,7 +64,8 @@ export class SendComponent { ...@@ -64,7 +64,8 @@ export class SendComponent {
'required': 'An address is required.' 'required': 'An address is required.'
}, },
'amount': { 'amount': {
'required': 'An amount is required.' 'required': 'An amount is required.',
'pattern': 'Enter a valid amount. Only positive numbers are allowed.'
}, },
'fee': { 'fee': {
'required': 'A fee is required.' 'required': 'A fee is required.'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment