From 2b477405395ab045af5b45915171d62795d3361b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 9 Dec 2020 12:10:34 +0200 Subject: [PATCH] dont post open wallets event until scene set --- .../sparrow/transaction/HeadersController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 477995fd..97e4cc91 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -420,12 +420,20 @@ public class HeadersController extends TransactionFormController implements Init signaturesProgressBar.initialize(headersForm.getSignatureKeystoreMap(), threshold); }); - Platform.runLater(() -> EventManager.get().post(new RequestOpenWalletsEvent())); + Platform.runLater(this::requestOpenWallets); } blockchainForm.setDynamicUpdate(this); } + private void requestOpenWallets() { + if(id.getScene() != null) { + EventManager.get().post(new RequestOpenWalletsEvent()); + } else { + Platform.runLater(this::requestOpenWallets); + } + } + private void updateType() { String type = "Legacy"; if(headersForm.getTransaction().isSegwit() || (headersForm.getPsbt() != null && headersForm.getPsbt().getPsbtInputs().stream().anyMatch(in -> in.getWitnessUtxo() != null))) {