disable receive address field once used

This commit is contained in:
Craig Raw 2021-04-20 11:46:36 +02:00
parent e62b44bbbe
commit 164742387f
2 changed files with 3 additions and 1 deletions

View file

@ -126,6 +126,7 @@ public class ReceiveController extends WalletFormController implements Initializ
lastUsed.setText("Never");
lastUsed.setGraphic(getUnusedGlyph());
address.getStyleClass().remove("error");
address.setDisable(false);
} else if(!currentOutputs.isEmpty()) {
long count = currentOutputs.size();
BlockTransactionHashIndex lastUsedReference = currentOutputs.stream().skip(count - 1).findFirst().get();
@ -133,11 +134,13 @@ public class ReceiveController extends WalletFormController implements Initializ
lastUsed.setGraphic(getWarningGlyph());
if(!address.getStyleClass().contains("error")) {
address.getStyleClass().add("error");
address.setDisable(true);
}
} else {
lastUsed.setText("Unknown");
lastUsed.setGraphic(null);
address.getStyleClass().remove("error");
address.setDisable(false);
}
}

View file

@ -9,7 +9,6 @@
<?import tornadofx.control.Fieldset?>
<?import tornadofx.control.Form?>
<?import tornadofx.control.Field?>
<?import com.sparrowwallet.sparrow.control.CopyableTextField?>
<?import javafx.geometry.Insets?>
<?import com.sparrowwallet.sparrow.control.CopyableLabel?>