edit tracker script to work under SSR sites

pull/1644/head
Sergei Meza 2022-10-18 11:05:25 +09:00
parent bf4de2fbf5
commit 019343085f
1 changed files with 6 additions and 1 deletions

View File

@ -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);
});
});
};