mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Fixes tracker code bug on handling pushState
- Enforcing .toString() on navigatedURL, because without it it returns an object and break history state changes; - Typo `navaigatedUrl` to `navigatedURL`;
This commit is contained in:
parent
80c3927048
commit
5db40efba6
@ -58,15 +58,15 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
|
|
||||||
/* Handle history */
|
/* Handle history */
|
||||||
|
|
||||||
const handlePush = (state, title, navaigatedUrl) => {
|
const handlePush = (state, title, navigatedURL) => {
|
||||||
removeEvents();
|
removeEvents();
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
|
|
||||||
if (navaigatedUrl.startsWith('http')) {
|
if (navigatedURL.toString().startsWith('http')) {
|
||||||
const url = new URL(navaigatedUrl);
|
const url = new URL(navigatedURL.toString());
|
||||||
currentUrl = `${url.pathname}${url.search}`;
|
currentUrl = `${url.pathname}${url.search}`;
|
||||||
} else {
|
} else {
|
||||||
currentUrl = navaigatedUrl;
|
currentUrl = navigatedURL.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
pageView();
|
pageView();
|
||||||
|
Loading…
Reference in New Issue
Block a user