diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreSectionBaseComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreSectionBaseComp.java index d743648dc..aef3b9191 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreSectionBaseComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreSectionBaseComp.java @@ -8,6 +8,7 @@ import io.xpipe.app.platform.BindingsHelper; import io.xpipe.app.platform.LabelGraphic; import io.xpipe.app.storage.DataStoreColor; +import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ObservableBooleanValue; @@ -88,11 +89,21 @@ public abstract class StoreSectionBaseComp extends Comp> { var children = new ArrayList<>(hbox.getChildren()); hbox.getChildren().clear(); root.visibleProperty().subscribe((newValue) -> { - if (newValue) { - hbox.getChildren().addAll(children); - } else { - hbox.getChildren().removeAll(children); - } + Platform.runLater(() -> { + if (newValue) { + if (!root.isVisible()) { + return; + } + + hbox.getChildren().addAll(children); + } else { + if (root.isVisible()) { + return; + } + + hbox.getChildren().removeAll(children); + } + }); }); }