Skip to content

Commit

Permalink
III-5746 - Make set of labels more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
brampauwelyn committed Oct 12, 2023
1 parent 93fad50 commit a26c80d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/pages/organizers/create/OrganizerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,10 @@ const OrganizerForm = () => {
// @ts-expect-error
const organizer = getOrganizerByIdQuery?.data;

const organizerLabelsSet = new Set<string>();

(organizer?.labels ?? []).map((label: string) =>
organizerLabelsSet.add(label),
);

(organizer?.hiddenLabels ?? []).map((label: string) =>
organizerLabelsSet.add(label),
);
const organizerLabelsSet = new Set([
...(organizer?.labels ?? []),
...(organizer?.hiddenLabels ?? []),
]);

const organizerLabels = [...organizerLabelsSet];

Expand Down

0 comments on commit a26c80d

Please sign in to comment.