Always check for store show

This commit is contained in:
crschnick 2024-08-31 11:33:11 +00:00
parent c7d38843da
commit 9c435c55f4
2 changed files with 13 additions and 11 deletions

View file

@ -70,12 +70,10 @@ public class StoreEntryListOverviewComp extends SimpleComp {
.equals(rootCategory); .equals(rootCategory);
// Sadly the all binding does not update when the individual visibility of entries changes // Sadly the all binding does not update when the individual visibility of entries changes
// But it is good enough. // But it is good enough.
var showProvider = var showProvider = true;
!storeEntryWrapper.getEntry().getValidity().isUsable() try {
|| storeEntryWrapper showProvider = storeEntryWrapper.getEntry().getProvider().shouldShow(storeEntryWrapper);
.getEntry() } catch (Exception ignored) {}
.getProvider()
.shouldShow(storeEntryWrapper);
return inRootCategory && showProvider; return inRootCategory && showProvider;
}, },
StoreViewState.get().getActiveCategory()); StoreViewState.get().getActiveCategory());

View file

@ -169,11 +169,15 @@ public class StoreSection {
// .orElse(false); // .orElse(false);
// is children. This check is fast as the children are cached in the storage // is children. This check is fast as the children are cached in the storage
return DataStorage.get().getStoreChildren(e.getEntry()).contains(other.getEntry()) if (!DataStorage.get().getStoreChildren(e.getEntry()).contains(other.getEntry())) {
&& return false;
// show provider }
(!other.getEntry().getValidity().isUsable()
|| other.getEntry().getProvider().shouldShow(other)); var showProvider = true;
try {
showProvider = other.getEntry().getProvider().shouldShow(other);
} catch (Exception ignored) {}
return showProvider;
}, },
e.getPersistentState(), e.getPersistentState(),
e.getCache(), e.getCache(),