handle offline state when initiating a collaborative mix

This commit is contained in:
Craig Raw 2021-12-16 08:56:01 +02:00
parent d1d1b0806f
commit 73b6b9219b

View file

@ -1398,6 +1398,14 @@ public class SendController extends WalletFormController implements Initializabl
@Subscribe @Subscribe
public void sorobanInitiated(SorobanInitiatedEvent event) { public void sorobanInitiated(SorobanInitiatedEvent event) {
if(event.getWallet().equals(getWalletForm().getWallet())) { if(event.getWallet().equals(getWalletForm().getWallet())) {
if(!AppServices.onlineProperty().get()) {
Optional<ButtonType> 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()); InitiatorDialog initiatorDialog = new InitiatorDialog(getWalletForm().getWalletId(), getWalletForm().getWallet(), walletTransactionProperty.get());
if(Config.get().isSameAppMixing()) { if(Config.get().isSameAppMixing()) {
initiatorDialog.initModality(Modality.NONE); initiatorDialog.initModality(Modality.NONE);