Fixed a bug, subitems were always showing
This commit is contained in:
parent
81c8cf08fb
commit
16891dfad1
|
@ -369,8 +369,7 @@ function filterItems(
|
||||||
showSecondaryItems: boolean,
|
showSecondaryItems: boolean,
|
||||||
items: Immutable<Props["items"]>
|
items: Immutable<Props["items"]>
|
||||||
): Immutable<Props["items"]> {
|
): Immutable<Props["items"]> {
|
||||||
const fileredItems = [...items] as Props["items"];
|
return [...items].filter((item) => {
|
||||||
fileredItems.filter((item) => {
|
|
||||||
if (!showSubitems && !item.attributes?.root_item) return false;
|
if (!showSubitems && !item.attributes?.root_item) return false;
|
||||||
if (
|
if (
|
||||||
showSubitems &&
|
showSubitems &&
|
||||||
|
@ -385,7 +384,6 @@ function filterItems(
|
||||||
if (!item.attributes?.primary && !showSecondaryItems) return false;
|
if (!item.attributes?.primary && !showSecondaryItems) return false;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
return fileredItems as Immutable<Props["items"]>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortBy(
|
function sortBy(
|
||||||
|
|
Loading…
Reference in New Issue