Skip to content

Commit

Permalink
🐛 Remove duplicate targets in advanced options screen
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Bolton <[email protected]>
  • Loading branch information
ibolton336 committed Jun 10, 2024
1 parent a316de3 commit f4b91a4
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions client/src/app/pages/applications/analysis-wizard/set-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,21 @@ export const SetOptions: React.FC = () => {
}
});

const defaultTargetsAndTargetsLabels = [
...defaultTargets,
...allTargetLabelsFromTargets,
].sort((t1, t2) => universalComparator(t1.label, t2.label));
const defaultTargetsAndTargetsLabels = Array.from(
new Map(
defaultTargets
.concat(allTargetLabelsFromTargets)
.map((item) => [item.label, item])
).values()
).sort((t1, t2) => universalComparator(t1.label, t2.label));

const defaultSourcesAndSourcesLabels = [
...new Set(defaultSources.concat(allSourceLabelsFromTargets)),
];
const defaultSourcesAndSourcesLabels = Array.from(
new Map(
defaultSources
.concat(allSourceLabelsFromTargets)
.map((item) => [item.label, item])
).values()
).sort((t1, t2) => universalComparator(t1.label, t2.label));

return (
<Form
Expand Down

0 comments on commit f4b91a4

Please sign in to comment.