set payment sent message state after sending message

This commit is contained in:
woodser 2024-02-01 13:00:37 -05:00
parent fabec9d396
commit c908294250
4 changed files with 26 additions and 18 deletions

View file

@ -194,18 +194,6 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
}
}
public void setMessageStatePropertyIfNotAcked(MessageState messageState) {
// skip if already acked
if (messageStateProperty.get() == MessageState.ACKNOWLEDGED) {
return;
}
if (trade != null) {
trade.getProcessModel().setPaymentSentMessageState(messageState);
}
}
private void onMessageStateChanged(MessageState messageState) {
messageStateProperty.set(messageState);
}

View file

@ -22,7 +22,6 @@ import haveno.common.UserThread;
import haveno.common.app.DevEnv;
import haveno.common.util.Tuple4;
import haveno.core.locale.Res;
import haveno.core.network.MessageState;
import haveno.core.offer.Offer;
import haveno.core.payment.PaymentAccount;
import haveno.core.payment.PaymentAccountUtil;
@ -158,7 +157,6 @@ public class BuyerStep2View extends TradeStepView {
case BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG:
busyAnimation.play();
statusLabel.setText(Res.get("shared.sendingConfirmation"));
model.setMessageStatePropertyIfNotAcked(MessageState.SENT);
timeoutTimer = UserThread.runAfter(() -> {
busyAnimation.stop();
statusLabel.setText(Res.get("shared.sendingConfirmationAgain"));
@ -167,18 +165,15 @@ public class BuyerStep2View extends TradeStepView {
case BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG:
busyAnimation.stop();
statusLabel.setText(Res.get("shared.messageStoredInMailbox"));
model.setMessageStatePropertyIfNotAcked(MessageState.STORED_IN_MAILBOX);
break;
case SELLER_RECEIVED_PAYMENT_SENT_MSG:
busyAnimation.stop();
statusLabel.setText(Res.get("shared.messageArrived"));
model.setMessageStatePropertyIfNotAcked(MessageState.ARRIVED);
break;
case BUYER_SEND_FAILED_PAYMENT_SENT_MSG:
// We get a popup and the trade closed, so we dont need to show anything here
busyAnimation.stop();
statusLabel.setText("");
model.setMessageStatePropertyIfNotAcked(MessageState.FAILED);
break;
default:
log.warn("Unexpected case: State={}, tradeId={} ", state.name(), trade.getId());