From 9ab152540a9b0b12fc90de75aaca98e1ccd483e6 Mon Sep 17 00:00:00 2001 From: Ruben Thoms Date: Wed, 18 Dec 2024 09:48:43 +0100 Subject: [PATCH] fixes --- .../{layerManagerComponent.tsx => layerManagerWrapper.tsx} | 5 +++-- frontend/src/modules/2DViewer/settings/settings.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) rename frontend/src/modules/2DViewer/settings/components/{layerManagerComponent.tsx => layerManagerWrapper.tsx} (97%) diff --git a/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx b/frontend/src/modules/2DViewer/settings/components/layerManagerWrapper.tsx similarity index 97% rename from frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx rename to frontend/src/modules/2DViewer/settings/components/layerManagerWrapper.tsx index 54e040211..7fcd50bb4 100644 --- a/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx +++ b/frontend/src/modules/2DViewer/settings/components/layerManagerWrapper.tsx @@ -9,7 +9,8 @@ import { MenuButton } from "@lib/components/MenuButton"; import { MenuHeading } from "@lib/components/MenuHeading"; import { MenuItem } from "@lib/components/MenuItem"; import { LayersActionGroup } from "@modules/2DViewer/layers/LayersActions"; -import { GroupDelegate } from "@modules/2DViewer/layers/delegates/GroupDelegate"; +import { GroupDelegate, GroupDelegateTopic } from "@modules/2DViewer/layers/delegates/GroupDelegate"; +import { usePublishSubscribeTopicValue } from "@modules/2DViewer/layers/delegates/PublishSubscribeDelegate"; import { ColorScale } from "@modules/2DViewer/layers/framework/ColorScale/ColorScale"; import { DeltaSurface } from "@modules/2DViewer/layers/framework/DeltaSurface/DeltaSurface"; import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; @@ -53,10 +54,10 @@ export type LayerManagerComponentWrapperProps = { export function LayerManagerComponentWrapper(props: LayerManagerComponentWrapperProps): React.ReactNode { const colorSet = props.workbenchSettings.useColorSet(); - const [preferredViewLayout, setPreferredViewLayout] = useAtom(preferredViewLayoutAtom); const groupDelegate = props.layerManager.getGroupDelegate(); + usePublishSubscribeTopicValue(groupDelegate, GroupDelegateTopic.CHILDREN); function handleLayerAction(identifier: string, groupDelegate: GroupDelegate) { const numSharedSettings = groupDelegate.findChildren((item) => { diff --git a/frontend/src/modules/2DViewer/settings/settings.tsx b/frontend/src/modules/2DViewer/settings/settings.tsx index 3c62c719e..3a7630738 100644 --- a/frontend/src/modules/2DViewer/settings/settings.tsx +++ b/frontend/src/modules/2DViewer/settings/settings.tsx @@ -10,7 +10,7 @@ import { useAtom, useAtomValue, useSetAtom } from "jotai"; import { layerManagerAtom, preferredViewLayoutAtom, userSelectedFieldIdentifierAtom } from "./atoms/baseAtoms"; import { selectedFieldIdentifierAtom } from "./atoms/derivedAtoms"; -import { LayerManagerComponentWrapper } from "./components/layerManagerComponent"; +import { LayerManagerComponentWrapper } from "./components/layerManagerWrapper"; import { GroupDelegateTopic } from "../layers/delegates/GroupDelegate"; import { LayerManager, LayerManagerTopic } from "../layers/framework/LayerManager/LayerManager";