Skip to content

Commit

Permalink
fix hashchange event
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly committed Sep 11, 2024
1 parent ec3fec7 commit aed63be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions logseq/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ if (document.querySelector("html").getAttribute("data-theme") === "light") {
}

document.querySelector(".journals-nav .flex-1").innerHTML = "Blog";

// Override the pushState method for correct hashchange event (for analytics)
// seems router issue
const originalPushState = history.pushState;

history.pushState = function (state, title, url) {
originalPushState.apply(history, arguments);
window.dispatchEvent(new Event("hashchange"));
};

1 comment on commit aed63be

@mastercyb
Copy link
Member

@mastercyb mastercyb commented on aed63be Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@happylolonly analytics stop working at all
image

Please sign in to comment.