From 019343085f0cb2381cb90f52d32497c1ebc6d6d7 Mon Sep 17 00:00:00 2001 From: Sergei Meza Date: Tue, 18 Oct 2022 11:05:25 +0900 Subject: [PATCH] edit tracker script to work under SSR sites --- tracker/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tracker/index.js b/tracker/index.js index 76f7de10..98ed4229 100644 --- a/tracker/index.js +++ b/tracker/index.js @@ -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); }); }); };