mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
commit
967c40b1d5
@ -134,7 +134,10 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
|
|
||||||
const handlePush = (state, title, url) => {
|
const handlePush = (state, title, url) => {
|
||||||
removeEvents();
|
removeEvents();
|
||||||
|
// url is not guaranteed
|
||||||
|
// thus calling `url.toString()` might causes exception, then break the pjax update
|
||||||
|
// track only if url is validate
|
||||||
|
if (url) {
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
const newUrl = url.toString();
|
const newUrl = url.toString();
|
||||||
|
|
||||||
@ -143,10 +146,13 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
} else {
|
} else {
|
||||||
currentUrl = newUrl;
|
currentUrl = newUrl;
|
||||||
}
|
}
|
||||||
|
// this function under some framework might be called multiple times
|
||||||
|
// thus only track if currentUrl and currentRef are not same
|
||||||
|
if (currentUrl !== currentRef) {
|
||||||
trackView(currentUrl, currentRef);
|
trackView(currentUrl, currentRef);
|
||||||
|
|
||||||
setTimeout(addEvents, 300);
|
setTimeout(addEvents, 300);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Global */
|
/* Global */
|
||||||
|
Loading…
Reference in New Issue
Block a user