@@ -122,30 +122,6 @@ const Link = ({
122122 ) ;
123123} ;
124124
125- function prefetch ( url : string ) {
126- return new Promise ( ( resolve , reject ) => {
127- const existingElement = [
128- ...( document . head ?. querySelectorAll ( 'script' ) || [ ] ) ,
129- // @ts -expect-error - FIXME when you are working on it
130- ] . find ( ( scriptElement ) => scriptElement . attributes . src ?. value === url ) ;
131-
132- if ( existingElement ) {
133- // @ts -expect-error - FIXME when you are working on it
134- resolve ( ) ;
135- }
136-
137- const script = document . createElement ( 'script' ) ;
138- script . src = url ;
139- script . async = true ;
140- script . onload = ( evt ) => {
141- script . setAttribute ( 'data-loaded' , 'true' ) ;
142- resolve ( evt ) ;
143- } ;
144- script . onerror = reject ;
145- document . head ?. appendChild ( script ) ;
146- } ) ;
147- }
148-
149125export const useNavbarLinksToActions = (
150126 links : TypeLink [ ] ,
151127) : {
@@ -154,8 +130,8 @@ export const useNavbarLinksToActions = (
154130} [ ] => {
155131 const location = useLocation ( ) ;
156132 const doesRouteMatch = useCallback (
157- ( path : RouteProps ) => {
158- return matchPath ( path . path + '*' , location . pathname ) ;
133+ ( { path, exact } : { path : string ; exact : boolean } ) => {
134+ return matchPath ( path + ( exact ? '' : '*' ) , location . pathname ) ;
159135 } ,
160136 [ location ] ,
161137 ) ;
@@ -181,6 +157,7 @@ export const useNavbarLinksToActions = (
181157 . find ( ( link ) =>
182158 link . view . isFederated
183159 ? doesRouteMatch ( {
160+ exact : link . view . view . exact ,
184161 path : link . view . view . activeIfMatches
185162 ? new RegExp (
186163 link . view . app . appHistoryBasePath +
0 commit comments