hm-tracking-sdk 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.es.js +5 -6
- package/dist/browser/index.umd.js +10 -10
- package/dist/sdk/telegram.js +26 -14
- package/dist/sdk/telegram.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.es.js
CHANGED
|
@@ -4369,12 +4369,11 @@ function isTelegramEnv() {
|
|
|
4369
4369
|
const r = window.Telegram.WebApp;
|
|
4370
4370
|
if (!r.initDataUnsafe || typeof r.initDataUnsafe != "object")
|
|
4371
4371
|
return !1;
|
|
4372
|
-
const f = r.initDataUnsafe.user && typeof r.initDataUnsafe.user == "object", d = "initData" in r;
|
|
4373
|
-
if (f
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
}
|
|
4377
|
-
return !1;
|
|
4372
|
+
const f = r.initDataUnsafe.user && typeof r.initDataUnsafe.user == "object" && typeof r.initDataUnsafe.user.id == "number" && r.initDataUnsafe.user.id > 0, d = "initData" in r && typeof r.initData == "string" && r.initData.length > 0;
|
|
4373
|
+
if (!f && !d)
|
|
4374
|
+
return !1;
|
|
4375
|
+
const m = r.platform;
|
|
4376
|
+
return !(m != null && typeof m == "string" && ["fake", "mock", "test"].includes(m.toLowerCase()) || Object.keys(r.initDataUnsafe || {}).length === 0 && !d);
|
|
4378
4377
|
} catch {
|
|
4379
4378
|
return !1;
|
|
4380
4379
|
}
|