Skip to content

Commit

Permalink
Query Parameters of link elements will not longer be ignored on clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
HousebirdGames committed Mar 13, 2024
1 parent 58a4ef0 commit 5e2fb3f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,16 +824,16 @@ function addLinkListeners() {

if (linkElement) {
let href = linkElement.getAttribute('href');
Analytics("Click: " + href);

const url = new URL(href, window.location.href);
href = url.origin + url.pathname;
Analytics("Click: " + href);
const cleanHref = url.origin + url.pathname;

let excludedRoutes = await window.triggerHook('get-spa-excluded-links') || [];

excludedRoutes = excludedRoutes.map(route => { return route.toLowerCase() });

if (excludedRoutes.includes(getRelativePath(href))) {
if (excludedRoutes.includes(getRelativePath(cleanHref))) {
return;
}

Expand All @@ -842,6 +842,7 @@ function addLinkListeners() {
}

event.preventDefault();
console.log('going to', href);
goToRoute(href);
}
};
Expand Down

0 comments on commit 5e2fb3f

Please sign in to comment.