Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export function ActorsProvider({
// biome-ignore lint/correctness/useExhaustiveDependencies: store is not a dependency
useEffect(() => {
if (internalFilter) {
store.set(actorsInternalFilterAtom, internalFilter);
store.set(actorsInternalFilterAtom, { fn: internalFilter });
} else {
store.set(actorsInternalFilterAtom, undefined);
}
}, [internalFilter]);

Expand Down
6 changes: 4 additions & 2 deletions frontend/packages/components/src/actors/actor-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export const actorRegionsAtom = atom<Region[]>([

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

export const actorsInternalFilterAtom = atom<(actor: Actor) => boolean>();
export const actorsInternalFilterAtom = atom<{
fn: (actor: Actor) => boolean;
}>();

// derived atoms

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

const isActorInternal = get(actorsInternalFilterAtom);
const isActorInternal = get(actorsInternalFilterAtom)?.fn;

return actors.filter((actor) => {
const satisfiesFilters = Object.entries(filters).every(
Expand Down
Loading