update pending trade item on UserThread

This commit is contained in:
woodser 2023-12-19 12:21:10 -05:00
parent 5ebf63e0de
commit 43f177d1f9
2 changed files with 2 additions and 12 deletions

View File

@ -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<VBox, PendingTrad
super.updateItem(newItem, empty);
if (!empty && newItem != null) {
trade = newItem.getTrade();
listener = (observable, oldValue, newValue) -> Platform.runLater(new Runnable() {
@Override public void run() {
update();
}
});
listener = (observable, oldValue, newValue) -> UserThread.execute(() -> update());
trade.stateProperty().addListener(listener);
update();
} else {

View File

@ -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;
}