File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ export default Service.extend({
3737
3838 currentRouteIndex : computed ( 'router.router.currentURL' , 'routeUrls.[]' , function ( ) {
3939 if ( this . get ( 'routeUrls.length' ) ) {
40- let currentURL = this . get ( 'router.router.currentURL' ) . replace ( / \/ $ / , "" ) ;
40+ let router = this . get ( 'router.router' ) ;
41+ let currentURL = router . get ( 'rootURL' ) + router . get ( 'currentURL' ) ;
42+ currentURL = currentURL
43+ . replace ( "//" , "/" ) // dedup slashes
44+ . replace ( / \/ $ / , "" ) ; // remove trailing slash
4145 let index = this . get ( 'routeUrls' ) . indexOf ( currentURL ) ;
4246 assert ( `DocsRoutes wasn't able to correctly detect the current route.` , index > - 1 ) ;
4347 return index ;
@@ -59,5 +63,5 @@ export default Service.extend({
5963 return this . get ( 'routes' ) [ ( currentIndex - 1 ) ] ;
6064 }
6165 } )
62-
66+
6367} ) ;
You can’t perform that action at this time.
0 commit comments