mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Update url checking logic.
This commit is contained in:
parent
8b9c3350b2
commit
4ae7ad35ff
@ -58,14 +58,14 @@ import { removeTrailingSlash } from '../lib/url';
|
|||||||
|
|
||||||
/* Handle history */
|
/* Handle history */
|
||||||
|
|
||||||
const handlePush = (state, title, navigatedURL) => {
|
const handlePush = (state, title, url) => {
|
||||||
removeEvents();
|
removeEvents();
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
const newUrl = navigatedURL.toString();
|
const newUrl = url.toString();
|
||||||
|
|
||||||
if (newUrl.startsWith('http')) {
|
if (newUrl.substring(0, 4) === 'http') {
|
||||||
const url = new URL(newUrl);
|
const { pathname, search } = new URL(newUrl);
|
||||||
currentUrl = `${url.pathname}${url.search}`;
|
currentUrl = `${pathname}${search}`;
|
||||||
} else {
|
} else {
|
||||||
currentUrl = newUrl;
|
currentUrl = newUrl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user