Skip to content

Commit

Permalink
fix issue with global filterset atom not updating on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Jul 30, 2024
1 parent 6c5c121 commit 6ca159e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/src/framework/GlobalAtoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { atomWithCompare } from "./utils/atomUtils";
export const EnsembleSetAtom = atomWithCompare<EnsembleSet>(new EnsembleSet([]), isEqual);

export const EnsembleRealizationFilterFunctionAtom = atom<EnsembleRealizationFilterFunction | null>((get) => {
const realizationFilterSet = get(RealizationFilterSetAtom);
const realizationFilterSet = get(RealizationFilterSetAtom)?.filterSet;

if (!realizationFilterSet) {
return null;
Expand All @@ -33,7 +33,6 @@ function areRealizationFilterSetsEqual(a: RealizationFilterSet | null, b: Realiz
return a.isEqual(b);
}

export const RealizationFilterSetAtom = atomWithCompare<RealizationFilterSet | null>(
null,
areRealizationFilterSetsEqual
);
export const RealizationFilterSetAtom = atomWithCompare<{
filterSet: RealizationFilterSet;
} | null>(null, (a, b) => areRealizationFilterSetsEqual(a?.filterSet ?? null, b?.filterSet ?? null));
1 change: 1 addition & 0 deletions frontend/src/framework/internal/WorkbenchSessionPrivate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class WorkbenchSessionPrivate extends WorkbenchSession {
}

notifyAboutEnsembleRealizationFilterChange(): void {
this._atomStoreMaster.setAtomValue(RealizationFilterSetAtom, { filterSet: this._realizationFilterSet });
this.notifySubscribers(WorkbenchSessionEvent.RealizationFilterSetChanged);
}
}

0 comments on commit 6ca159e

Please sign in to comment.