Fix bug with displaying wrong tx id if deposit tx id was missing in trade process

This commit is contained in:
Manfred Karrer 2016-11-19 16:22:35 +01:00
parent 90565bf43b
commit 16a542696e
3 changed files with 14 additions and 3 deletions

View File

@ -126,6 +126,7 @@ public class TxIdTextField extends AnchorPane {
textField.setOnMouseClicked(null);
blockExplorerIcon.setOnMouseClicked(null);
copyIcon.setOnMouseClicked(null);
textField.setText("");
}

View File

@ -291,6 +291,8 @@ public class PendingTradesDataModel extends ActivatableDataModel {
isOfferer = tradeManager.isMyOffer(trade.getOffer());
if (trade.getDepositTx() != null)
txId.set(trade.getDepositTx().getHashAsString());
else
txId.set("");
notificationCenter.setSelectedTradeId(trade.getId());
} else {
notificationCenter.setSelectedTradeId(null);

View File

@ -95,7 +95,12 @@ public abstract class TradeStepView extends AnchorPane {
if (txIdSubscription != null)
txIdSubscription.unsubscribe();
txIdSubscription = EasyBind.subscribe(model.dataModel.txId, id -> txIdTextField.setup(id));
txIdSubscription = EasyBind.subscribe(model.dataModel.txId, id -> {
if (!id.isEmpty())
txIdTextField.setup(id);
else
txIdTextField.cleanup();
});
}
trade.errorMessageProperty().addListener(errorMessageListener);
@ -162,8 +167,11 @@ public abstract class TradeStepView extends AnchorPane {
protected void addTradeInfoBlock() {
tradeInfoTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 4, "Trade information");
txIdTextField = addLabelTxIdTextField(gridPane, gridRow, "Deposit transaction ID:", Layout.FIRST_ROW_DISTANCE).second;
if (model.dataModel.txId.get() != null)
txIdTextField.setup(model.dataModel.txId.get());
String id = model.dataModel.txId.get();
if (!id.isEmpty())
txIdTextField.setup(id);
else
txIdTextField.cleanup();
PaymentMethodForm.addAllowedPeriod(gridPane, ++gridRow, model.dataModel.getSellersPaymentAccountContractData(),
model.getDateForOpenDispute());