From b3aa8485c445f3a55b5c99b04b7cfa280ae25182 Mon Sep 17 00:00:00 2001 From: Ruben Thoms Date: Fri, 14 Jun 2024 14:21:41 +0200 Subject: [PATCH] Adjust wellpicks settings when custom polyline is selected --- .../settings/components/layerSettings/wellpicksLayer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/modules/Intersection/settings/components/layerSettings/wellpicksLayer.tsx b/frontend/src/modules/Intersection/settings/components/layerSettings/wellpicksLayer.tsx index 153967604..916cb21aa 100644 --- a/frontend/src/modules/Intersection/settings/components/layerSettings/wellpicksLayer.tsx +++ b/frontend/src/modules/Intersection/settings/components/layerSettings/wellpicksLayer.tsx @@ -6,7 +6,7 @@ import { WorkbenchSettings } from "@framework/WorkbenchSettings"; import { PendingWrapper } from "@lib/components/PendingWrapper"; import { Select, SelectOption } from "@lib/components/Select"; import { Switch } from "@lib/components/Switch"; -import { LayerStatus, useLayerStatus } from "@modules/Intersection/utils/layers/BaseLayer"; +import { LayerStatus, useLayerSettings, useLayerStatus } from "@modules/Intersection/utils/layers/BaseLayer"; import { WellpicksLayer, WellpicksLayerSettings } from "@modules/Intersection/utils/layers/WellpicksLayer"; export type WellpicksLayerSettingsComponentProps = { @@ -17,8 +17,8 @@ export type WellpicksLayerSettingsComponentProps = { }; export function WellpicksLayerSettingsComponent(props: WellpicksLayerSettingsComponentProps): React.ReactNode { + const settings = useLayerSettings(props.layer); const [newSettings, setNewSettings] = React.useState>({}); - const settings = props.layer.getSettings(); const status = useLayerStatus(props.layer); @@ -47,7 +47,7 @@ export function WellpicksLayerSettingsComponent(props: WellpicksLayerSettingsCom const unitPicksFilterOptions: SelectOption[] = []; const nonUnitPicksFilterOptions: SelectOption[] = []; const data = props.layer.getData(); - if (data) { + if (data && props.layer.getStatus() === LayerStatus.SUCCESS) { unitPicksFilterOptions.push( ...Array.from(new Set(data.unitPicks.map((pick) => pick.name))).map((name) => ({ label: name,