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, {
16
16
query : null ,
17
17
selectedIndex : null ,
18
18
19
- init ( ) {
19
+ didInsertElement ( ) {
20
20
this . _super ( ) ;
21
21
22
22
this . set ( 'keyboardActivated' , true ) ;
23
+
23
24
// Start downloading the search index immediately
24
25
this . get ( 'docsSearch' ) . loadSearchIndex ( ) ;
25
26
} ,
@@ -45,11 +46,14 @@ export default Component.extend(EKMixin, {
45
46
46
47
searchResults : computed ( 'rawSearchResults.[]' , function ( ) {
47
48
let rawSearchResults = this . get ( 'rawSearchResults' ) ;
49
+ let router = this . get ( 'router' ) ;
50
+ let routerMicrolib = router . _router . _routerMicrolib || router . _router . router ;
48
51
49
52
if ( rawSearchResults ) {
50
53
let filteredSearchResults = this . get ( 'rawSearchResults' )
51
54
. filter ( ( { document } ) => {
52
- return document . route !== 'not-found' ;
55
+ let routeExists = routerMicrolib . recognizer . names [ document . route ] ;
56
+ return routeExists && document . route !== 'not-found' ;
53
57
} )
54
58
. filter ( ( { document } ) => {
55
59
let isClassTemplate = ( document . route === 'docs.api.class' && document . type === 'template' ) ;
You can’t perform that action at this time.
0 commit comments