close mutable offer view on fx thread (#1325)

This commit is contained in:
woodser 2024-10-13 08:31:49 -04:00 committed by GitHub
parent 6b688194f1
commit cda610fdfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@
package haveno.desktop.main.portfolio; package haveno.desktop.main.portfolio;
import com.google.inject.Inject; import com.google.inject.Inject;
import haveno.common.UserThread;
import haveno.core.locale.Res; import haveno.core.locale.Res;
import haveno.core.offer.OfferPayload; import haveno.core.offer.OfferPayload;
import haveno.core.offer.OpenOffer; import haveno.core.offer.OpenOffer;
@ -200,7 +201,7 @@ public class PortfolioView extends ActivatableView<TabPane, Void> {
editOfferView.applyOpenOffer(openOffer); editOfferView.applyOpenOffer(openOffer);
editOpenOfferTab = new Tab(Res.get("portfolio.tab.editOpenOffer").toUpperCase()); editOpenOfferTab = new Tab(Res.get("portfolio.tab.editOpenOffer").toUpperCase());
editOfferView.setCloseHandler(() -> { editOfferView.setCloseHandler(() -> {
root.getTabs().remove(editOpenOfferTab); UserThread.execute(() -> root.getTabs().remove(editOpenOfferTab));
}); });
root.getTabs().add(editOpenOfferTab); root.getTabs().add(editOpenOfferTab);
} }
@ -220,7 +221,7 @@ public class PortfolioView extends ActivatableView<TabPane, Void> {
duplicateOfferView.initWithData((OfferPayload) data); duplicateOfferView.initWithData((OfferPayload) data);
duplicateOfferTab = new Tab(Res.get("portfolio.tab.duplicateOffer").toUpperCase()); duplicateOfferTab = new Tab(Res.get("portfolio.tab.duplicateOffer").toUpperCase());
duplicateOfferView.setCloseHandler(() -> { duplicateOfferView.setCloseHandler(() -> {
root.getTabs().remove(duplicateOfferTab); UserThread.execute(() -> root.getTabs().remove(duplicateOfferTab));
}); });
root.getTabs().add(duplicateOfferTab); root.getTabs().add(duplicateOfferTab);
} }