@@ -62,7 +62,7 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
62
62
return platformsAndGuides ;
63
63
}
64
64
// any of these fields can be used to match the search value
65
- const keys = [ 'title' , 'aliases' , 'name' , 'sdk' , 'keywords' , 'topLevelAlias ' ] ;
65
+ const keys = [ 'title' , 'aliases' , 'name' , 'sdk' , 'keywords' , 'platformTitle ' ] ;
66
66
const matches_ = matchSorter ( platformsAndGuides , filter , {
67
67
keys,
68
68
threshold : rankings . CONTAINS ,
@@ -195,7 +195,14 @@ function PlatformWithGuides({
195
195
196
196
const guides = useMemo ( ( ) => {
197
197
const showPlatformInContent = matchKeys . includes ( platform . key ) ;
198
- return showPlatformInContent ? [ platform , ...platform . guides ] : platform . guides ;
198
+
199
+ // This is the case if `platformTitle` is configured for a platform
200
+ // In this case, we do not need to add the platform to the list of guides
201
+ const hasGuideWithPlatformKey = platform . guides . some ( g => g . key === platform . key ) ;
202
+
203
+ return showPlatformInContent && ! hasGuideWithPlatformKey
204
+ ? [ platform , ...platform . guides ]
205
+ : platform . guides ;
199
206
} , [ matchKeys , platform ] ) ;
200
207
201
208
return (
@@ -213,7 +220,7 @@ function PlatformWithGuides({
213
220
format = "lg"
214
221
className = { `${ styles . PlatformIcon } !border-none !shadow-none` }
215
222
/>
216
- { platform . topLevelAlias ?? platform . title }
223
+ { platform . title }
217
224
</ div >
218
225
< button className = { styles . ChevronButton } >
219
226
< TriangleRightIcon
0 commit comments