Skip to content

Commit 262bcb8

Browse files
Merge pull request #402 from nicolethoen/dedupe_qs_links
fix(QSDrawerContent): prevent duplication of qs in drawer content
2 parents 72fdcb8 + d73f3af commit 262bcb8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/module/src/QuickStartDrawerContent.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ export const QuickStartDrawerContent: FC<QuickStartDrawerContentProps> = ({
2424
allQuickStarts = [],
2525
activeQuickStartState,
2626
} = useContext<QuickStartContextValues>(QuickStartContext);
27-
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
27+
const combinedQuickStarts = [
28+
...allQuickStarts,
29+
...quickStarts,
30+
].filter(
31+
(qs, idx, arr) => arr.findIndex(q => q.metadata.name === qs.metadata.name) === idx
32+
);
2833

2934
const handleClose = () => {
3035
handleDrawerClose && handleDrawerClose(activeQuickStartState?.status);

0 commit comments

Comments
 (0)