Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 19b2d4b

Browse files
refactor(page): remove query string check from the skipSamePath logic
is better to keep this logic fairly simple and use the custom method for different use cases see #73
1 parent c44eeb5 commit 19b2d4b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/lib/page.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,11 @@ export function autotracking () {
7979

8080
config.router.afterEach(function (to, from) {
8181
const { skipSamePath, shouldRouterUpdate } = autoTracking
82-
const hasSamePath = to.path === from.path
83-
const hasQueryString = hasProps(to.query) || hasProps(from.query)
8482

8583
// Default behaviour of the router when the `skipSamePath` is turned on.
8684
// Skip router change when current and previous route have the same path
87-
// but query string props are empty on both sides
8885
// https://github.com/MatteoGabriele/vue-analytics/issues/73
89-
if (skipSamePath && (hasSamePath && !hasQueryString)) {
86+
if (skipSamePath && to.path === from.path) {
9087
return
9188
}
9289

0 commit comments

Comments
 (0)