From 07455f8f060dd5ddc7723be42a54ef402a604661 Mon Sep 17 00:00:00 2001 From: Ruben Thoms Date: Tue, 30 Jul 2024 14:03:55 +0200 Subject: [PATCH] fix --- frontend/src/framework/GlobalAtoms.ts | 17 ++++++--------- .../internal/WorkbenchSessionPrivate.ts | 4 +++- .../settings/atoms/derivedAtoms.ts | 21 +------------------ 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/frontend/src/framework/GlobalAtoms.ts b/frontend/src/framework/GlobalAtoms.ts index 8f3c9a92a..06ba2f424 100644 --- a/frontend/src/framework/GlobalAtoms.ts +++ b/frontend/src/framework/GlobalAtoms.ts @@ -21,18 +21,13 @@ export const EnsembleRealizationFilterFunctionAtom = atom(null, (a, b) => areRealizationFilterSetsEqual(a?.filterSet ?? null, b?.filterSet ?? null)); +} | null>(null, (a, b) => areRealizationFilterSetsEqual(a, b)); diff --git a/frontend/src/framework/internal/WorkbenchSessionPrivate.ts b/frontend/src/framework/internal/WorkbenchSessionPrivate.ts index 23cb113a0..1bc9f6575 100644 --- a/frontend/src/framework/internal/WorkbenchSessionPrivate.ts +++ b/frontend/src/framework/internal/WorkbenchSessionPrivate.ts @@ -26,7 +26,9 @@ export class WorkbenchSessionPrivate extends WorkbenchSession { } notifyAboutEnsembleRealizationFilterChange(): void { - this._atomStoreMaster.setAtomValue(RealizationFilterSetAtom, { filterSet: this._realizationFilterSet }); + this._atomStoreMaster.setAtomValue(RealizationFilterSetAtom, { + filterSet: this._realizationFilterSet, + }); this.notifySubscribers(WorkbenchSessionEvent.RealizationFilterSetChanged); } } diff --git a/frontend/src/modules/Intersection/settings/atoms/derivedAtoms.ts b/frontend/src/modules/Intersection/settings/atoms/derivedAtoms.ts index 9ab9954a7..0432d8f8b 100644 --- a/frontend/src/modules/Intersection/settings/atoms/derivedAtoms.ts +++ b/frontend/src/modules/Intersection/settings/atoms/derivedAtoms.ts @@ -1,6 +1,6 @@ import { EnsembleIdent } from "@framework/EnsembleIdent"; import { EnsembleSet } from "@framework/EnsembleSet"; -import { EnsembleRealizationFilterFunctionAtom, EnsembleSetAtom } from "@framework/GlobalAtoms"; +import { EnsembleSetAtom } from "@framework/GlobalAtoms"; import { IntersectionPolylinesAtom } from "@framework/userCreatedItems/IntersectionPolylines"; import { LayerManager } from "@modules/Intersection/utils/layers/LayerManager"; @@ -37,25 +37,6 @@ export const selectedFieldIdentifierAtom = atom((get) => { return selectedFieldIdentifier; }); -export const availableRealizationsAtom = atom((get) => { - const ensembleSet = get(EnsembleSetAtom); - const selectedEnsembleIdent = get(selectedEnsembleIdentAtom); - - if (selectedEnsembleIdent === null) { - return []; - } - - let ensembleRealizationFilterFunction = get(EnsembleRealizationFilterFunctionAtom); - - if (ensembleRealizationFilterFunction === null) { - ensembleRealizationFilterFunction = (ensembleIdent: EnsembleIdent) => { - return ensembleSet.findEnsemble(ensembleIdent)?.getRealizations() ?? []; - }; - } - - return ensembleRealizationFilterFunction(selectedEnsembleIdent); -}); - export const availableUserCreatedIntersectionPolylinesAtom = atom((get) => { const intersectionPolylines = get(IntersectionPolylinesAtom); return intersectionPolylines;