diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java index b40745d27d..69083f371c 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java @@ -402,6 +402,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel { if (!id.isEmpty()) - makerTxIdTextField.setup(id); + selfTxIdTextField.setup(id); else - makerTxIdTextField.cleanup(); + selfTxIdTextField.cleanup(); }); } - if (takerTxIdTextField != null) { + if (peerTxIdTextField != null) { if (takerTxIdSubscription != null) takerTxIdSubscription.unsubscribe(); takerTxIdSubscription = EasyBind.subscribe(model.dataModel.takerTxId, id -> { if (!id.isEmpty()) - takerTxIdTextField.setup(id); + peerTxIdTextField.setup(id); else - takerTxIdTextField.cleanup(); + peerTxIdTextField.cleanup(); }); } trade.errorMessageProperty().addListener(errorMessageListener); @@ -293,10 +293,10 @@ public abstract class TradeStepView extends AnchorPane { if (takerTxIdSubscription != null) takerTxIdSubscription.unsubscribe(); - if (makerTxIdTextField != null) - makerTxIdTextField.cleanup(); - if (takerTxIdTextField != null) - takerTxIdTextField.cleanup(); + if (selfTxIdTextField != null) + selfTxIdTextField.cleanup(); + if (peerTxIdTextField != null) + peerTxIdTextField.cleanup(); if (errorMessageListener != null) trade.errorMessageProperty().removeListener(errorMessageListener); @@ -336,35 +336,35 @@ public abstract class TradeStepView extends AnchorPane { Res.get("portfolio.pending.tradeInformation")); GridPane.setColumnSpan(tradeInfoTitledGroupBg, 2); - // maker - final Tuple3 labelMakerTxIdTextFieldVBoxTuple3 = + // self's deposit tx id + final Tuple3 labelSelfTxIdTextFieldVBoxTuple3 = addTopLabelTxIdTextField(gridPane, gridRow, - Res.get("shared.depositTransactionId"), // TODO (woodser): need separate labels for maker and taker deposit tx ids + "Your " + Res.get("shared.depositTransactionId").toLowerCase(), Layout.COMPACT_FIRST_ROW_DISTANCE); - GridPane.setColumnSpan(labelMakerTxIdTextFieldVBoxTuple3.third, 2); - makerTxIdTextField = labelMakerTxIdTextFieldVBoxTuple3.second; + GridPane.setColumnSpan(labelSelfTxIdTextFieldVBoxTuple3.third, 2); + selfTxIdTextField = labelSelfTxIdTextFieldVBoxTuple3.second; - String makerId = model.dataModel.makerTxId.get(); - if (!makerId.isEmpty()) - makerTxIdTextField.setup(makerId); + String selfTxId = model.dataModel.isMaker() ? model.dataModel.makerTxId.get() : model.dataModel.takerTxId.get(); + if (!selfTxId.isEmpty()) + selfTxIdTextField.setup(selfTxId); else - makerTxIdTextField.cleanup(); + selfTxIdTextField.cleanup(); - // taker - final Tuple3 labelTakerTxIdTextFieldVBoxTuple3 = - addTopLabelTxIdTextField(gridPane, gridRow, - Res.get("shared.depositTransactionId"), - Layout.COMPACT_FIRST_ROW_DISTANCE); + // peer's deposit tx id + final Tuple3 labelPeerTxIdTextFieldVBoxTuple3 = + addTopLabelTxIdTextField(gridPane, ++gridRow, + "Peer's " + Res.get("shared.depositTransactionId").toLowerCase(), + -Layout.GROUP_DISTANCE_WITHOUT_SEPARATOR); - GridPane.setColumnSpan(labelTakerTxIdTextFieldVBoxTuple3.third, 2); - takerTxIdTextField = labelTakerTxIdTextFieldVBoxTuple3.second; + GridPane.setColumnSpan(labelPeerTxIdTextFieldVBoxTuple3.third, 2); + peerTxIdTextField = labelPeerTxIdTextFieldVBoxTuple3.second; - String takerId = model.dataModel.takerTxId.get(); - if (!takerId.isEmpty()) - takerTxIdTextField.setup(takerId); + String peerTxId = model.dataModel.isMaker() ? model.dataModel.takerTxId.get() : model.dataModel.makerTxId.get(); + if (!peerTxId.isEmpty()) + peerTxIdTextField.setup(peerTxId); else - takerTxIdTextField.cleanup(); + peerTxIdTextField.cleanup(); if (model.dataModel.getTrade() != null) { checkNotNull(model.dataModel.getTrade().getOffer(), "Offer must not be null in TradeStepView");