From c3778b6419987b2ea6eafe3b66dbd3570e3914b6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 10 Nov 2021 16:13:23 +0200 Subject: [PATCH] fix version update hyperlink appearing multiple times --- drongo | 2 +- .../java/com/sparrowwallet/sparrow/AppController.java | 11 +++++++++-- .../com/sparrowwallet/sparrow/wallet/mixto.fxml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drongo b/drongo index 6c03c410..f46d6277 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 6c03c4106ae612c0b80370c3ed5495b1ba9225bc +Subproject commit f46d6277551cdb69286fbc3a6e536e0542cb7170 diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index fbd1775c..1ac11f17 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -1957,8 +1957,15 @@ public class AppController implements Initializable { AppServices.get().getApplication().getHostServices().showDocument("https://www.sparrowwallet.com/download"); }); - if(statusBar.getRightItems().size() > 0 && statusBar.getRightItems().get(0) instanceof Hyperlink) { - statusBar.getRightItems().remove(0); + Hyperlink existingUpdateLabel = null; + for(Node node : statusBar.getRightItems()) { + if(node instanceof Hyperlink) { + existingUpdateLabel = (Hyperlink)node; + } + } + + if(existingUpdateLabel != null) { + statusBar.getRightItems().remove(existingUpdateLabel); } statusBar.getRightItems().add(0, versionUpdateLabel); diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/mixto.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/mixto.fxml index 0a8a3270..37762b61 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/mixto.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/mixto.fxml @@ -31,7 +31,7 @@
- +