@@ -62,7 +62,7 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
6262 return platformsAndGuides ;
6363 }
6464 // 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 ' ] ;
6666 const matches_ = matchSorter ( platformsAndGuides , filter , {
6767 keys,
6868 threshold : rankings . CONTAINS ,
@@ -195,7 +195,14 @@ function PlatformWithGuides({
195195
196196 const guides = useMemo ( ( ) => {
197197 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 ;
199206 } , [ matchKeys , platform ] ) ;
200207
201208 return (
@@ -213,7 +220,7 @@ function PlatformWithGuides({
213220 format = "lg"
214221 className = { `${ styles . PlatformIcon } !border-none !shadow-none` }
215222 />
216- { platform . topLevelAlias ?? platform . title }
223+ { platform . title }
217224 </ div >
218225 < button className = { styles . ChevronButton } >
219226 < TriangleRightIcon
0 commit comments