mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Fix children not properly refreshing across different categories for #207
This commit is contained in:
parent
c2ac2481e4
commit
a4faa7c04c
1 changed files with 14 additions and 2 deletions
|
@ -101,7 +101,7 @@ public class StoreSection {
|
|||
var matchesSelector = section.anyMatches(entryFilter);
|
||||
var sameCategory = category == null
|
||||
|| category.getValue() == null
|
||||
|| category.getValue().contains(section.getWrapper());
|
||||
|| inCategory(category.getValue(),section.getWrapper());
|
||||
return showFilter && matchesSelector && sameCategory;
|
||||
},
|
||||
category,
|
||||
|
@ -140,7 +140,7 @@ public class StoreSection {
|
|||
var matchesSelector = section.anyMatches(entryFilter);
|
||||
var sameCategory = category == null
|
||||
|| category.getValue() == null
|
||||
|| category.getValue().contains(section.getWrapper());
|
||||
|| inCategory(category.getValue(),section.getWrapper());
|
||||
// If this entry is already shown as root due to a different category than parent, don't show it
|
||||
// again here
|
||||
var notRoot =
|
||||
|
@ -161,4 +161,16 @@ public class StoreSection {
|
|||
|| c.test(wrapper)
|
||||
|| allChildren.stream().anyMatch(storeEntrySection -> storeEntrySection.anyMatches(c));
|
||||
}
|
||||
|
||||
private static boolean inCategory(StoreCategoryWrapper categoryWrapper, StoreEntryWrapper entryWrapper) {
|
||||
var current = entryWrapper.getCategory().getValue();
|
||||
while (current != null) {
|
||||
if (categoryWrapper.getCategory().getUuid().equals(current.getCategory().getUuid())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
current = current.getParent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue