]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix(history): preserve location and state when cancelling navigations
authorEduardo San Martin Morote <posva13@gmail.com>
Sat, 12 Oct 2019 13:12:09 +0000 (15:12 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Sat, 12 Oct 2019 13:12:09 +0000 (15:12 +0200)
src/history/html5.2.ts

index 3247ad1b1a98a83e92dfa04a9b8fb699b4a4831b..da46380ec40429f29254f12079f898c6f5b9bfdb 100644 (file)
@@ -111,6 +111,8 @@ export default function createHistory(): RouterHistory {
     const from = location
     const fromState = historyState
     const to = createCurrentLocation(window.location)
+    location = to
+    historyState = state
 
     if (pauseState && pauseState.to && pauseState.to.fullPath === to.fullPath) {
       cs.info('Ignored beacuse paused')
@@ -119,8 +121,6 @@ export default function createHistory(): RouterHistory {
       return
     }
 
-    location = to
-    historyState = state
     const deltaFromCurrent = fromState
       ? state.position - fromState.position
       : ''