mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Revert changes in sidebar-items.injectable
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
2852a4f8d2
commit
06fd0e2b37
@ -17,8 +17,6 @@ import {
|
|||||||
orderBy,
|
orderBy,
|
||||||
some,
|
some,
|
||||||
} from "lodash/fp";
|
} from "lodash/fp";
|
||||||
import sidebarStorageInjectable, { SidebarStorageState } from "./sidebar-storage/sidebar-storage.injectable";
|
|
||||||
import type { StorageLayer } from "../../utils";
|
|
||||||
|
|
||||||
export interface SidebarItemRegistration {
|
export interface SidebarItemRegistration {
|
||||||
id: string;
|
id: string;
|
||||||
@ -46,7 +44,6 @@ const sidebarItemsInjectable = getInjectable({
|
|||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const computedInjectMany = di.inject(computedInjectManyInjectable);
|
const computedInjectMany = di.inject(computedInjectManyInjectable);
|
||||||
const sidebarStorage: StorageLayer<SidebarStorageState> = di.inject(sidebarStorageInjectable)
|
|
||||||
const sidebarItemRegistrations = computedInjectMany(sidebarItemsInjectionToken);
|
const sidebarItemRegistrations = computedInjectMany(sidebarItemsInjectionToken);
|
||||||
|
|
||||||
return computed((): HierarchicalSidebarItem[] => {
|
return computed((): HierarchicalSidebarItem[] => {
|
||||||
@ -65,8 +62,6 @@ const sidebarItemsInjectable = getInjectable({
|
|||||||
map((registration) => {
|
map((registration) => {
|
||||||
const children = _getSidebarItemsHierarchy(registration.id);
|
const children = _getSidebarItemsHierarchy(registration.id);
|
||||||
|
|
||||||
const parentExpanded = () => Boolean(sidebarStorage.get().expanded[registration.id])
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
registration,
|
registration,
|
||||||
children,
|
children,
|
||||||
@ -80,7 +75,6 @@ const sidebarItemsInjectable = getInjectable({
|
|||||||
children,
|
children,
|
||||||
invokeMap("isActive.get"),
|
invokeMap("isActive.get"),
|
||||||
some(identity),
|
some(identity),
|
||||||
(identityFound) => identityFound && !parentExpanded(),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user