From f843b5477bd04e48fe8a43f7ff741a5bf9dec4db Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Thu, 3 Dec 2020 11:19:18 -0500 Subject: [PATCH] Fixes https://github.com/bisq-network/bisq/issues/4864 When seller if offline we resend the CounterCurrencyTransferStartedMessage at startup. That caused the trade state set to BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG and then after the msg was stored in mailbox to BUYER_STORED_IN_MAILBOX_FIAT_PAYMENT_INITIATED_MSG. Those 2 msg trigger diff. UI states which led to the UI glitch that the UI moved to step 2 and then to step 3 which was correct but confusing to the user. Now we only apply BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG is trade state ordinal is smaller avoiding that UI glitch. --- .../buyer/BuyerSendCounterCurrencyTransferStartedMessage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendCounterCurrencyTransferStartedMessage.java b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendCounterCurrencyTransferStartedMessage.java index 54a334c6d46..bfe50a9be18 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendCounterCurrencyTransferStartedMessage.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendCounterCurrencyTransferStartedMessage.java @@ -82,7 +82,9 @@ protected TradeMessage getMessage(String tradeId) { @Override protected void setStateSent() { - trade.setStateIfValidTransitionTo(Trade.State.BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG); + if (trade.getState().ordinal() < Trade.State.BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG.ordinal()) { + trade.setStateIfValidTransitionTo(Trade.State.BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG); + } processModel.getTradeManager().requestPersistence(); }