From 29ac15846d22fbd3782e844047faa10b5d0f958a Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 15 Jan 2025 13:07:18 +0200 Subject: [PATCH] disable broadcast progress bar if disconnected, and re-enable if connected again --- .../sparrow/transaction/HeadersController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index b7ec2b7f..cf3cb7b4 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -1647,6 +1647,19 @@ public class HeadersController extends TransactionFormController implements Init } } + @Subscribe + public void connection(ConnectionEvent event) { + broadcastProgressBar.setDisable(false); + } + + @Subscribe + public void disconnection(DisconnectionEvent event) { + broadcastProgressBar.setDisable(true); + if(broadcastProgressBar.getProgress() < 0) { + broadcastProgressBar.setProgress(0); + } + } + private static class WalletSignComparator implements Comparator { private static final List sourceOrder = List.of(KeystoreSource.SW_WATCH, KeystoreSource.HW_AIRGAPPED, KeystoreSource.HW_USB, KeystoreSource.SW_SEED);