Fix possibility of selecting own children as hosts

This commit is contained in:
crschnick 2024-05-27 16:52:33 +00:00
parent 9c565de56b
commit a5309f3614

View file

@ -6,6 +6,7 @@ import io.xpipe.app.core.AppFont;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.storage.DataStoreEntryRef;
import io.xpipe.app.util.DataStoreCategoryChoiceComp;
@ -76,7 +77,7 @@ public class DataStoreChoiceComp<T extends DataStore> extends SimpleComp {
Predicate<StoreEntryWrapper> applicable = storeEntryWrapper -> {
var e = storeEntryWrapper.getEntry();
if (e.equals(self)) {
if (e.equals(self) || DataStorage.get().getStoreParentHierarchy(e).contains(self)) {
return false;
}