Skip to content

Commit 117f5dd

Browse files
authored
fix: change invalid atom value (#2600)
1 parent ce4e2b0 commit 117f5dd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

frontend/apps/hub/src/domains/project/components/actors/actors-provider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export function ActorsProvider({
9191
// biome-ignore lint/correctness/useExhaustiveDependencies: store is not a dependency
9292
useEffect(() => {
9393
if (internalFilter) {
94-
store.set(actorsInternalFilterAtom, internalFilter);
94+
store.set(actorsInternalFilterAtom, { fn: internalFilter });
95+
} else {
96+
store.set(actorsInternalFilterAtom, undefined);
9597
}
9698
}, [internalFilter]);
9799

frontend/packages/components/src/actors/actor-context.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export const actorRegionsAtom = atom<Region[]>([
112112

113113
export const actorBuildsAtom = atom<Build[]>([]);
114114

115-
export const actorsInternalFilterAtom = atom<(actor: Actor) => boolean>();
115+
export const actorsInternalFilterAtom = atom<{
116+
fn: (actor: Actor) => boolean;
117+
}>();
116118

117119
// derived atoms
118120

@@ -129,7 +131,7 @@ export const filteredActorsAtom = atom((get) => {
129131
const filters = get(actorFiltersAtom);
130132
const actors = get(actorsAtom);
131133

132-
const isActorInternal = get(actorsInternalFilterAtom);
134+
const isActorInternal = get(actorsInternalFilterAtom)?.fn;
133135

134136
return actors.filter((actor) => {
135137
const satisfiesFilters = Object.entries(filters).every(

0 commit comments

Comments
 (0)