dont post open wallets event until scene set

This commit is contained in:
Craig Raw 2020-12-09 12:10:34 +02:00
parent 668dd88436
commit 2b47740539

View file

@ -420,12 +420,20 @@ public class HeadersController extends TransactionFormController implements Init
signaturesProgressBar.initialize(headersForm.getSignatureKeystoreMap(), threshold); signaturesProgressBar.initialize(headersForm.getSignatureKeystoreMap(), threshold);
}); });
Platform.runLater(() -> EventManager.get().post(new RequestOpenWalletsEvent())); Platform.runLater(this::requestOpenWallets);
} }
blockchainForm.setDynamicUpdate(this); blockchainForm.setDynamicUpdate(this);
} }
private void requestOpenWallets() {
if(id.getScene() != null) {
EventManager.get().post(new RequestOpenWalletsEvent());
} else {
Platform.runLater(this::requestOpenWallets);
}
}
private void updateType() { private void updateType() {
String type = "Legacy"; String type = "Legacy";
if(headersForm.getTransaction().isSegwit() || (headersForm.getPsbt() != null && headersForm.getPsbt().getPsbtInputs().stream().anyMatch(in -> in.getWitnessUtxo() != null))) { if(headersForm.getTransaction().isSegwit() || (headersForm.getPsbt() != null && headersForm.getPsbt().getPsbtInputs().stream().anyMatch(in -> in.getWitnessUtxo() != null))) {