chore: eventing + refactoring

This commit is contained in:
Cory Dransfeldt 2024-03-25 10:10:39 -07:00
parent 9a957159e9
commit d05bcc1b77
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
let ig;
let ignore;
let url = `https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}`
if (window.localStorage && window.localStorage.getItem('ig')) {
ig = localStorage.getItem('ig')
url = `${url}&ig=${ig}`
if (window.localStorage && window.localStorage.getItem('ignore')) {
ignore = localStorage.getItem('ignore')
url = `${url}&ignore=${ignore}`
}
if (!window.fathom) fetch(url).then(() => {}).catch(() => {});