diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java index 74235657..e29ec824 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java @@ -422,11 +422,17 @@ public class BuyerStep2View extends TradeStepView { HBox hBox = tuple3.fourth; GridPane.setColumnSpan(hBox, 2); confirmButton = tuple3.first; + confirmButton.setDisable(!confirmPaymentSentPermitted()); confirmButton.setOnAction(e -> onPaymentSent()); busyAnimation = tuple3.second; statusLabel = tuple3.third; } + private boolean confirmPaymentSentPermitted() { + if (!trade.confirmPermitted()) return false; + return trade.isDepositsUnlocked() && trade.getState().ordinal() < Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal(); + } + /////////////////////////////////////////////////////////////////////////////////////////// // Warning /////////////////////////////////////////////////////////////////////////////////////////// @@ -454,8 +460,7 @@ public class BuyerStep2View extends TradeStepView { @Override protected void updateDisputeState(Trade.DisputeState disputeState) { super.updateDisputeState(disputeState); - - confirmButton.setDisable(!trade.confirmPermitted()); + confirmButton.setDisable(!confirmPaymentSentPermitted()); } @@ -596,11 +601,14 @@ public class BuyerStep2View extends TradeStepView { private void confirmPaymentSent() { busyAnimation.play(); statusLabel.setText(Res.get("shared.sendingConfirmation")); + confirmButton.setDisable(true); model.dataModel.onPaymentSent(() -> { }, errorMessage -> { busyAnimation.stop(); new Popup().warning(Res.get("popup.warning.sendMsgFailed")).show(); + confirmButton.setDisable(!confirmPaymentSentPermitted()); + UserThread.execute(() -> statusLabel.setText("Error confirming payment sent.")); }); } diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java index 5229aacb..19d29ec3 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java @@ -307,7 +307,7 @@ public class SellerStep3View extends TradeStepView { private boolean confirmPaymentReceivedPermitted() { if (!trade.confirmPermitted()) return false; - return trade.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal(); // TODO: test that can resen with same payout tx hex if delivery failed + return trade.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal(); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -354,7 +354,6 @@ public class SellerStep3View extends TradeStepView { @Override protected void updateDisputeState(Trade.DisputeState disputeState) { super.updateDisputeState(disputeState); - confirmButton.setDisable(!confirmPaymentReceivedPermitted()); }