diff --git a/src/index.ts b/src/index.ts index d6d7ff2..1f046b5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,11 +53,16 @@ export function sync( ) // sync store on router navigation - const afterEachUnHook = router.afterEach((to, from) => { + const afterEachUnHook = router.afterEach((to, from, failure) => { if (isTimeTraveling) { isTimeTraveling = false return } + + if (failure) { + return; + } + currentPath = to.fullPath store.commit(moduleName + '/ROUTE_CHANGED', { to, from }) })