mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-02-02 03:06:33 +00:00
update pending trade item on UserThread
This commit is contained in:
parent
5ebf63e0de
commit
43f177d1f9
2 changed files with 2 additions and 12 deletions
|
@ -54,7 +54,6 @@ import haveno.desktop.util.CssTheme;
|
||||||
import haveno.desktop.util.DisplayUtils;
|
import haveno.desktop.util.DisplayUtils;
|
||||||
import haveno.desktop.util.FormBuilder;
|
import haveno.desktop.util.FormBuilder;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import javafx.application.Platform;
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||||
import javafx.beans.value.ChangeListener;
|
import javafx.beans.value.ChangeListener;
|
||||||
|
@ -931,11 +930,7 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
|
||||||
super.updateItem(newItem, empty);
|
super.updateItem(newItem, empty);
|
||||||
if (!empty && newItem != null) {
|
if (!empty && newItem != null) {
|
||||||
trade = newItem.getTrade();
|
trade = newItem.getTrade();
|
||||||
listener = (observable, oldValue, newValue) -> Platform.runLater(new Runnable() {
|
listener = (observable, oldValue, newValue) -> UserThread.execute(() -> update());
|
||||||
@Override public void run() {
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
trade.stateProperty().addListener(listener);
|
trade.stateProperty().addListener(listener);
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -424,12 +424,7 @@ public abstract class TradeStepView extends AnchorPane {
|
||||||
log.warn("deactivating TradeStepView because model's trade is null");
|
log.warn("deactivating TradeStepView because model's trade is null");
|
||||||
|
|
||||||
// schedule deactivation to avoid concurrent modification of clock listeners
|
// schedule deactivation to avoid concurrent modification of clock listeners
|
||||||
Platform.runLater(new Runnable() {
|
Platform.runLater(() -> deactivate());
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
deactivate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue