Skip to content

Commit 115e2da

Browse files
committed
preserve match sort order for guides in platform selector
1 parent ca9fe31 commit 115e2da

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/platformSelector/index.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,15 @@ export function PlatformSelector({
195195
platform={{
196196
...platform,
197197
// only keep guides that are in the matches list
198-
guides: platform.guides.filter(g =>
199-
matches.some(m => m.key === g.key)
200-
),
198+
guides: platform.guides
199+
.filter(g =>
200+
matches.some(m => m.key === g.key && m.type === 'guide')
201+
)
202+
.sort((a, b) => {
203+
const indexA = matches.findIndex(m => m.key === a.key);
204+
const indexB = matches.findIndex(m => m.key === b.key);
205+
return indexA - indexB;
206+
}),
201207

202208
integrations: platform.integrations.filter(i =>
203209
matches.some(m => m.key === i.key)

0 commit comments

Comments
 (0)