Skip to content

Commit

Permalink
Fixed non-catastrophic build failure (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis authored Apr 11, 2023
1 parent 8a2314f commit 136181a
Show file tree
Hide file tree
Showing 3 changed files with 1,210 additions and 1,059 deletions.
6 changes: 4 additions & 2 deletions ui/src/app/form/Dependencies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export default function Dependencies() {
clear,
]);

const dependencies: Dependency[] = React.useMemo(() => selectedDependencies.filter(d => !!d), [selectedDependencies]);

return (
<>
<Grid
Expand Down Expand Up @@ -79,8 +81,8 @@ export default function Dependencies() {
)}
</Grid>
<List>
{selectedDependencies.map(
(s: Dependency | undefined, idx: number) => (
{dependencies.map(
(s: Dependency, idx: number) => (
<Fragment key={idx}>
{s !== undefined ? (
<ListItem
Expand Down
16 changes: 8 additions & 8 deletions ui/src/app/store/OverlayReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ export function useMappedOverlayDependencies() {
const selected = useOverlayDependencies();
const list = useDependencyList();

return React.useMemo(
() =>
orderBy(
selected.map((s: string) =>
list.find((d: Dependency) => d.id === s)
),
return React.useMemo<Dependency[]>(
() => {
let l: any[] = selected.map((s: string) => list.find((d: Dependency) => d.id === s));
l = l.filter((d: Dependency | undefined) => !!d);
return orderBy<Dependency>(
l,
["name"],
"asc"
),
[selected, list]
);
}, [selected, list]
);
}

Expand Down
Loading

0 comments on commit 136181a

Please sign in to comment.