Skip to content

Commit

Permalink
Adjust wellpicks settings when custom polyline is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Jun 14, 2024
1 parent a67c8d9 commit b3aa848
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -17,8 +17,8 @@ export type WellpicksLayerSettingsComponentProps = {
};

export function WellpicksLayerSettingsComponent(props: WellpicksLayerSettingsComponentProps): React.ReactNode {
const settings = useLayerSettings(props.layer);
const [newSettings, setNewSettings] = React.useState<Partial<WellpicksLayerSettings>>({});
const settings = props.layer.getSettings();

const status = useLayerStatus(props.layer);

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b3aa848

Please sign in to comment.