@@ -2,7 +2,6 @@ import { BROWSER, DEV } from 'esm-env';
22import { isActive } from './helpers/is-active.js' ;
33import { matchRoute } from './helpers/match-route.js' ;
44import { preload , preloadOnHover } from './helpers/preload.js' ;
5- import { Navigation } from './navigation.js' ;
65import {
76 constructPath ,
87 constructUrl ,
@@ -13,6 +12,7 @@ import {
1312 stripBase ,
1413 updatedLocation ,
1514} from './helpers/utils.js' ;
15+ import { Navigation } from './navigation.js' ;
1616import { syncSearchParams } from './search-params.svelte.js' ;
1717
1818/** @type {import('./index.d.ts').Routes } */
@@ -134,7 +134,7 @@ function navigate(path, options = {}) {
134134}
135135
136136/**
137- * @param {string } path
137+ * @param {string } [ path]
138138 * @param {import('./index.d.ts').NavigateOptions } options
139139 */
140140export async function onNavigate ( path , options = { } ) {
@@ -145,7 +145,7 @@ export async function onNavigate(path, options = {}) {
145145 navigationIndex ++ ;
146146 const currentNavigationIndex = navigationIndex ;
147147
148- let matchPath = getMatchPath ( path ) ;
148+ const matchPath = getMatchPath ( path ) ;
149149 const { match, layouts, hooks, meta : newMeta , params : newParams } = matchRoute ( matchPath , routes ) ;
150150
151151 const search = parseSearch ( options . search ) ;
@@ -179,7 +179,7 @@ export async function onNavigate(path, options = {}) {
179179 }
180180 if (
181181 navigationIndex !== currentNavigationIndex ||
182- ( fromBeforeLoadHook && pendingNavigationIndex + 1 !== currentNavigationIndex )
182+ ( fromBeforeLoadHook && pendingNavigationIndex !== currentNavigationIndex )
183183 ) {
184184 return ;
185185 }
0 commit comments