mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +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 => {
|
||||
const {
|
||||
screen: { width, height },
|
||||
|
|
@ -84,7 +85,7 @@
|
|||
});
|
||||
|
||||
const getClientIPAddress = () => {
|
||||
return new Promise(res => {
|
||||
return new Promise((res, rej) => {
|
||||
if (ip) {
|
||||
res(ip);
|
||||
return;
|
||||
|
|
@ -95,6 +96,10 @@
|
|||
ip = data.ip;
|
||||
res(ip);
|
||||
return;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
rej(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue