mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +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
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
EventManager.get().register(this);
|
EventManager.get().register(this);
|
||||||
|
@ -163,6 +165,10 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
revalidate(amount, amountListener);
|
revalidate(amount, amountListener);
|
||||||
maxButton.setDisable(!isValidRecipientAddress());
|
maxButton.setDisable(!isValidRecipientAddress());
|
||||||
updateTransaction();
|
updateTransaction();
|
||||||
|
|
||||||
|
if(validationSupport != null) {
|
||||||
|
validationSupport.setErrorDecorationEnabled(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
label.textProperty().addListener((observable, oldValue, newValue) -> {
|
label.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
@ -287,7 +293,7 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addValidation() {
|
private void addValidation() {
|
||||||
ValidationSupport validationSupport = new ValidationSupport();
|
validationSupport = new ValidationSupport();
|
||||||
validationSupport.registerValidator(address, Validator.combine(
|
validationSupport.registerValidator(address, Validator.combine(
|
||||||
(Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Invalid Address", !newValue.isEmpty() && !isValidRecipientAddress())
|
(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);
|
targetBlocks.setValue(4);
|
||||||
utxoSelectorProperty.setValue(null);
|
utxoSelectorProperty.setValue(null);
|
||||||
walletTransactionProperty.setValue(null);
|
walletTransactionProperty.setValue(null);
|
||||||
|
|
||||||
|
validationSupport.setErrorDecorationEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void revalidate(TextField field, ChangeListener<String> listener) {
|
private void revalidate(TextField field, ChangeListener<String> listener) {
|
||||||
|
|
Loading…
Reference in a new issue