From 164742387ff9403cebd5307e56a7cfa58517a1b3 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 20 Apr 2021 11:46:36 +0200 Subject: [PATCH] disable receive address field once used --- .../com/sparrowwallet/sparrow/wallet/ReceiveController.java | 3 +++ src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java index 6196d241..1f6d9cba 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java @@ -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); } } diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml index 0fed65ac..7e7a7765 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml @@ -9,7 +9,6 @@ -