fix FX application thread error in portfolio view #1356

This commit is contained in:
woodser 2024-10-29 08:33:36 -04:00
parent 123a2a8487
commit f470112cae

View File

@ -140,8 +140,10 @@ public class PortfolioView extends ActivatableView<TabPane, Void> {
@Override
protected void activate() {
failedTradesManager.getObservableList().addListener((ListChangeListener<Trade>) c -> {
if (failedTradesManager.getObservableList().size() > 0 && root.getTabs().size() == 3)
root.getTabs().add(failedTradesTab);
UserThread.execute(() -> {
if (failedTradesManager.getObservableList().size() > 0 && root.getTabs().size() == 3)
root.getTabs().add(failedTradesTab);
});
});
if (failedTradesManager.getObservableList().size() > 0 && root.getTabs().size() == 3)
root.getTabs().add(failedTradesTab);