mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 23:06:02 -04:00
Fix trade state update bug
This commit is contained in:
parent
b87a27922a
commit
f9859b3a13
@ -163,9 +163,6 @@ class PendingTradesModel extends UIModel {
|
||||
if (selectedItem != null) {
|
||||
isOfferer = getTrade().getOffer().getMessagePublicKey().equals(user.getMessagePublicKey());
|
||||
|
||||
// we want to re-trigger a change if the state is the same but different trades
|
||||
tradeState.set(null);
|
||||
|
||||
Trade trade = getTrade();
|
||||
if (trade.getDepositTx() != null)
|
||||
txId.set(trade.getDepositTx().getHashAsString());
|
||||
|
@ -122,6 +122,7 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||
|
||||
void selectTrade(PendingTradesListItem item) {
|
||||
model.selectTrade(item);
|
||||
updateState();
|
||||
}
|
||||
|
||||
void fiatPaymentStarted() {
|
||||
@ -250,6 +251,7 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||
|
||||
private void updateState() {
|
||||
if (model.tradeState.get() != null) {
|
||||
log.debug("tradeState " + model.tradeState.get());
|
||||
switch (model.tradeState.get()) {
|
||||
case DEPOSIT_PUBLISHED:
|
||||
state.set(model.isOfferer() ? State.OFFERER_BUYER_WAIT_TX_CONF : State.TAKER_SELLER_WAIT_TX_CONF);
|
||||
|
@ -133,11 +133,10 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||
txIdTextField.setup(presentationModel.getWalletService(), newValue);
|
||||
|
||||
selectedItemChangeListener = (obsValue, oldValue, newValue) -> {
|
||||
if (oldValue != null && newValue != null)
|
||||
if (oldValue != null && newValue != null) {
|
||||
presentationModel.selectTrade(newValue);
|
||||
// TODO only clearSelection when there are more at least one remaining trades
|
||||
/* else if (newValue == null)
|
||||
table.getSelectionModel().clearSelection();*/
|
||||
updateScreen();
|
||||
}
|
||||
};
|
||||
|
||||
listChangeListener = change -> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user