mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
hide validation error on clear send
This commit is contained in:
parent
ead8fa2207
commit
e878c4ea78
1 changed files with 9 additions and 1 deletions
|
@ -152,6 +152,8 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
}
|
||||
};
|
||||
|
||||
private ValidationSupport validationSupport;
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
EventManager.get().register(this);
|
||||
|
@ -163,6 +165,10 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
revalidate(amount, amountListener);
|
||||
maxButton.setDisable(!isValidRecipientAddress());
|
||||
updateTransaction();
|
||||
|
||||
if(validationSupport != null) {
|
||||
validationSupport.setErrorDecorationEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
label.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
@ -287,7 +293,7 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
}
|
||||
|
||||
private void addValidation() {
|
||||
ValidationSupport validationSupport = new ValidationSupport();
|
||||
validationSupport = new ValidationSupport();
|
||||
validationSupport.registerValidator(address, Validator.combine(
|
||||
(Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Invalid Address", !newValue.isEmpty() && !isValidRecipientAddress())
|
||||
));
|
||||
|
@ -537,6 +543,8 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
targetBlocks.setValue(4);
|
||||
utxoSelectorProperty.setValue(null);
|
||||
walletTransactionProperty.setValue(null);
|
||||
|
||||
validationSupport.setErrorDecorationEnabled(false);
|
||||
}
|
||||
|
||||
private void revalidate(TextField field, ChangeListener<String> listener) {
|
||||
|
|
Loading…
Reference in a new issue