chore: fixes

This commit is contained in:
Cory Dransfeldt 2024-03-24 13:03:46 -07:00
parent 86a6b02e5f
commit 48e83d95f5
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -2,8 +2,8 @@ const id = Math.floor(Math.random() * Date.now())
let i;
let url = `https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&num=${sessionStorage.getItem('id' || id)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}`
if (window.sessionStorage && !window.sessionStorage?.getItem('id')) sessionStorage.setItem('id', id)
if (window.localStorage && window.localStorage.getItem('i')) {
i = localStorage.getItem('i')
url = `${url}&i=${i}`
if (window.localStorage && window.localStorage.getItem('ig')) {
ig = localStorage.getItem('ig')
url = `${url}&ig=${ig}`
}
if (!window.fathom) fetch(url).then((data) => {}).catch(err => {});
if (!window.fathom) fetch(url).then(() => {}).catch(() => {});