From: Eduardo San Martin Morote Date: Sat, 12 Oct 2019 13:12:09 +0000 (+0200) Subject: fix(history): preserve location and state when cancelling navigations X-Git-Tag: v4.0.0-alpha.0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba46478fcd3de6df0c073ccd5e4666171d94aadb;p=thirdparty%2Fvuejs%2Frouter.git fix(history): preserve location and state when cancelling navigations --- diff --git a/src/history/html5.2.ts b/src/history/html5.2.ts index 3247ad1b..da46380e 100644 --- a/src/history/html5.2.ts +++ b/src/history/html5.2.ts @@ -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 : ''