From 4ebee8a8f320228eb4f79e18ce34ceb0625852de Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 29 Sep 2021 10:41:16 +0200 Subject: [PATCH] dont allow double click to receive on whirlpool wallet --- .../sparrow/control/AddressTreeTable.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java b/src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java index a00d1e21..2f82e80e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java @@ -68,21 +68,23 @@ public class AddressTreeTable extends CoinTreeTable { } } - setOnMouseClicked(mouseEvent -> { - if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){ - if(mouseEvent.getClickCount() == 2) { - TreeItem treeItem = getSelectionModel().getSelectedItem(); - if(treeItem != null && treeItem.getChildren().isEmpty()) { - Entry entry = getSelectionModel().getSelectedItem().getValue(); - if(entry instanceof NodeEntry) { - NodeEntry nodeEntry = (NodeEntry)entry; - EventManager.get().post(new ReceiveActionEvent(nodeEntry)); - Platform.runLater(() -> EventManager.get().post(new ReceiveToEvent(nodeEntry))); + if(!rootEntry.getWallet().isWhirlpoolChildWallet()) { + setOnMouseClicked(mouseEvent -> { + if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){ + if(mouseEvent.getClickCount() == 2) { + TreeItem treeItem = getSelectionModel().getSelectedItem(); + if(treeItem != null && treeItem.getChildren().isEmpty()) { + Entry entry = getSelectionModel().getSelectedItem().getValue(); + if(entry instanceof NodeEntry) { + NodeEntry nodeEntry = (NodeEntry)entry; + EventManager.get().post(new ReceiveActionEvent(nodeEntry)); + Platform.runLater(() -> EventManager.get().post(new ReceiveToEvent(nodeEntry))); + } } } } - } - }); + }); + } rootEntry.getChildren().addListener((ListChangeListener) c -> { this.refresh();