File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
packages/router/src/navigation-api Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -816,6 +816,32 @@ export function createNavigationApiRouter(options: RouterApiOptions): Router {
816816 ) {
817817 // see above
818818 started = true
819+ const initialLocation = resolve (
820+ window . location . pathname +
821+ window . location . search +
822+ window . location . hash
823+ ) as RouteLocationNormalized
824+ pendingLocation = initialLocation
825+ resolveNavigationGuards ( initialLocation , START_LOCATION_NORMALIZED )
826+ . then ( ( ) => {
827+ finalizeNavigation ( initialLocation , START_LOCATION_NORMALIZED )
828+ } )
829+ . catch ( err => {
830+ const failure = err as NavigationFailure
831+ if (
832+ isNavigationFailure ( failure , ErrorTypes . NAVIGATION_GUARD_REDIRECT )
833+ ) {
834+ return navigate ( ( failure as NavigationRedirectError ) . to , {
835+ replace : true ,
836+ } )
837+ } else {
838+ return triggerError (
839+ failure ,
840+ initialLocation ,
841+ START_LOCATION_NORMALIZED
842+ )
843+ }
844+ } )
819845 }
820846
821847 const reactiveRoute = { } as RouteLocationNormalizedLoaded
You can’t perform that action at this time.
0 commit comments