Skip to content

Commit cc75202

Browse files
committed
fix(QSDrawer): prevent duplication of qs in drawer
1 parent 52c3245 commit cc75202

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)