mirror of
https://github.com/danbulant/Mangades
synced 2026-07-07 20:10:36 +00:00
fix skipping first navigation
This commit is contained in:
parent
f5d7d2108b
commit
dce011fcd3
1 changed files with 1 additions and 3 deletions
|
|
@ -10,12 +10,10 @@
|
||||||
if(browser) {
|
if(browser) {
|
||||||
apm.setInitialPageLoadName($page.route.id);
|
apm.setInitialPageLoadName($page.route.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let skipFirst = true;
|
|
||||||
let last = typeof window !== "undefined" && window.location.pathname;
|
let last = typeof window !== "undefined" && window.location.pathname;
|
||||||
afterNavigate(page => {
|
afterNavigate(page => {
|
||||||
if(!["link", "popstate"].includes(page.type)) return; // ignore post hydration and automatic goto
|
if(!["link", "popstate"].includes(page.type)) return; // ignore post hydration and automatic goto
|
||||||
if(skipFirst) return skipFirst = false;
|
|
||||||
if(window.goatcounter) window.goatcounter.count({
|
if(window.goatcounter) window.goatcounter.count({
|
||||||
path: window.location.pathname,
|
path: window.location.pathname,
|
||||||
title: page.title,
|
title: page.title,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue