Skip to content

Commit 9e5cc5f

Browse files
Merge pull request #403 from nicolethoen/dedupe_in_v5
fix(QSDrawer): prevent duplication of qs in drawer
2 parents 52c3245 + cc75202 commit 9e5cc5f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/module/src/QuickStartDrawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ export const QuickStartDrawer: React.FC<QuickStartDrawerProps> = ({
165165
setAllQuickStartStates,
166166
useLegacyHeaderColors,
167167
} = React.useContext<QuickStartContextValues>(QuickStartContext);
168-
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
168+
const combinedQuickStarts = [
169+
...allQuickStarts,
170+
...quickStarts,
171+
].filter(
172+
(qs, idx, arr) => arr.findIndex(q => q.metadata.name === qs.metadata.name) === idx
173+
);
169174
React.useEffect(() => {
170175
const params = new URLSearchParams(window.location.search);
171176
// if there is a quick start param, but the quick start is not active, set it

0 commit comments

Comments
 (0)