File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
addon/components/docs-viewer/x-search Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ export default Component.extend(EKMixin, {
1616 query : null ,
1717 selectedIndex : null ,
1818
19- init ( ) {
19+ didInsertElement ( ) {
2020 this . _super ( ) ;
2121
2222 this . set ( 'keyboardActivated' , true ) ;
23+
2324 // Start downloading the search index immediately
2425 this . get ( 'docsSearch' ) . loadSearchIndex ( ) ;
2526 } ,
@@ -45,11 +46,14 @@ export default Component.extend(EKMixin, {
4546
4647 searchResults : computed ( 'rawSearchResults.[]' , function ( ) {
4748 let rawSearchResults = this . get ( 'rawSearchResults' ) ;
49+ let router = this . get ( 'router' ) ;
50+ let routerMicrolib = router . _router . _routerMicrolib || router . _router . router ;
4851
4952 if ( rawSearchResults ) {
5053 let filteredSearchResults = this . get ( 'rawSearchResults' )
5154 . filter ( ( { document } ) => {
52- return document . route !== 'not-found' ;
55+ let routeExists = routerMicrolib . recognizer . names [ document . route ] ;
56+ return routeExists && document . route !== 'not-found' ;
5357 } )
5458 . filter ( ( { document } ) => {
5559 let isClassTemplate = ( document . route === 'docs.api.class' && document . type === 'template' ) ;
You can’t perform that action at this time.
0 commit comments