mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 04:25:39 +01:00
edit tracker script to work under SSR sites
This commit is contained in:
parent
bf4de2fbf5
commit
019343085f
1 changed files with 6 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable no-console */
|
||||||
(window => {
|
(window => {
|
||||||
const {
|
const {
|
||||||
screen: { width, height },
|
screen: { width, height },
|
||||||
|
|
@ -84,7 +85,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const getClientIPAddress = () => {
|
const getClientIPAddress = () => {
|
||||||
return new Promise(res => {
|
return new Promise((res, rej) => {
|
||||||
if (ip) {
|
if (ip) {
|
||||||
res(ip);
|
res(ip);
|
||||||
return;
|
return;
|
||||||
|
|
@ -95,6 +96,10 @@
|
||||||
ip = data.ip;
|
ip = data.ip;
|
||||||
res(ip);
|
res(ip);
|
||||||
return;
|
return;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
rej(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue