diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java index 64a7b5571c..8df9fdb33d 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java @@ -320,12 +320,12 @@ public class PendingTradesDataModel extends ActivatableDataModel { for (Trade trade : tradeManager.getObservableList()) { if (isTradeShown(trade)) { if (hiddenTrades.contains(trade)) { - trade.stateProperty().removeListener(hiddenStateChangeListener); + UserThread.execute(() -> trade.stateProperty().removeListener(hiddenStateChangeListener)); hiddenTrades.remove(trade); } } else { if (!hiddenTrades.contains(trade)) { - trade.stateProperty().addListener(hiddenStateChangeListener); + UserThread.execute(() -> trade.stateProperty().addListener(hiddenStateChangeListener)); hiddenTrades.add(trade); } } @@ -390,7 +390,7 @@ public class PendingTradesDataModel extends ActivatableDataModel { takerTxId.set(nullToEmptyString(takerDepositTxHash)); if (makerDepositTxHash != null || takerDepositTxHash != null) { notificationCenter.setSelectedTradeId(tradeId); - selectedTrade.stateProperty().removeListener(tradeStateChangeListener); + UserThread.execute(() -> selectedTrade.stateProperty().removeListener(tradeStateChangeListener)); } }; selectedTrade.stateProperty().addListener(tradeStateChangeListener); diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java index 6886b3fdd2..fa8ac81a9c 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -544,9 +544,12 @@ public class PendingTradesView extends ActivatableViewAndModel { + trade.stateProperty().removeListener(tradeStateListener); + trade.disputeStateProperty().addListener(disputeStateListener); + trade.mediationResultStateProperty().addListener(mediationResultStateListener); + }); + traderChatManager.requestPersistence(); });