mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-11-28 23:46:40 -05:00
add or remove trade state listeners on jfx thread (#2043)
This commit is contained in:
parent
b450b87d0a
commit
b525f34e53
2 changed files with 9 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -544,9 +544,12 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
|
|||
chatPopupStage.xProperty().removeListener(yPositionListener);
|
||||
}
|
||||
|
||||
trade.stateProperty().removeListener(tradeStateListener);
|
||||
trade.disputeStateProperty().addListener(disputeStateListener);
|
||||
trade.mediationResultStateProperty().addListener(mediationResultStateListener);
|
||||
UserThread.execute(() -> {
|
||||
trade.stateProperty().removeListener(tradeStateListener);
|
||||
trade.disputeStateProperty().addListener(disputeStateListener);
|
||||
trade.mediationResultStateProperty().addListener(mediationResultStateListener);
|
||||
});
|
||||
|
||||
traderChatManager.requestPersistence();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue