From 43f177d1f9458b07fa57b46b5c7fb8e9b4038522 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 19 Dec 2023 12:21:10 -0500 Subject: [PATCH] update pending trade item on UserThread --- .../main/portfolio/pendingtrades/PendingTradesView.java | 7 +------ .../main/portfolio/pendingtrades/steps/TradeStepView.java | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) 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 b309de20a3..02f1943bcf 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 @@ -54,7 +54,6 @@ import haveno.desktop.util.CssTheme; import haveno.desktop.util.DisplayUtils; import haveno.desktop.util.FormBuilder; import haveno.network.p2p.NodeAddress; -import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.ChangeListener; @@ -931,11 +930,7 @@ public class PendingTradesView extends ActivatableViewAndModel Platform.runLater(new Runnable() { - @Override public void run() { - update(); - } - }); + listener = (observable, oldValue, newValue) -> UserThread.execute(() -> update()); trade.stateProperty().addListener(listener); update(); } else { diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java index d236a6c373..362518ae94 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java @@ -424,12 +424,7 @@ public abstract class TradeStepView extends AnchorPane { log.warn("deactivating TradeStepView because model's trade is null"); // schedule deactivation to avoid concurrent modification of clock listeners - Platform.runLater(new Runnable() { - @Override - public void run() { - deactivate(); - } - }); + Platform.runLater(() -> deactivate()); return; }