Skip to content

Commit 68202a3

Browse files
committed
tweak
1 parent 186e8ab commit 68202a3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ exports.sync = function (store, router, options) {
2121
return
2222
}
2323
isTimeTraveling = true
24-
if (!currentPath) {
25-
router.replace(route)
26-
} else {
27-
router.push(route)
28-
}
24+
var methodToUse = currentPath == null
25+
? 'replace'
26+
: 'push'
2927
currentPath = route.fullPath
28+
router[methodToUse](route)
3029
},
3130
{ sync: true }
3231
)

0 commit comments

Comments
 (0)