From 73b6b9219b0c4d0f5522e61fd31f95528aeb0580 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 16 Dec 2021 08:56:01 +0200 Subject: [PATCH] handle offline state when initiating a collaborative mix --- .../com/sparrowwallet/sparrow/wallet/SendController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index 2238e21f..a7e0601d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -1398,6 +1398,14 @@ public class SendController extends WalletFormController implements Initializabl @Subscribe public void sorobanInitiated(SorobanInitiatedEvent event) { if(event.getWallet().equals(getWalletForm().getWallet())) { + if(!AppServices.onlineProperty().get()) { + Optional optButtonType = AppServices.showErrorDialog("Cannot Mix Offline", "Sparrow needs to be connected to a server to perform collaborative mixes. Try to connect?", ButtonType.CANCEL, ButtonType.OK); + if(optButtonType.isPresent() && optButtonType.get() == ButtonType.OK) { + AppServices.onlineProperty().set(true); + } + return; + } + InitiatorDialog initiatorDialog = new InitiatorDialog(getWalletForm().getWalletId(), getWalletForm().getWallet(), walletTransactionProperty.get()); if(Config.get().isSameAppMixing()) { initiatorDialog.initModality(Modality.NONE);