Telemetry and graphic changes

This commit is contained in:
Vladyslav Matsiiako
2023-01-05 13:11:13 -08:00
parent 5a19f8ed32
commit c921eb8781
4 changed files with 299 additions and 313 deletions
-16
View File
@@ -1,16 +0,0 @@
import posthog from 'posthog-js';
import { ENV, POSTHOG_API_KEY, POSTHOG_HOST } from '../utilities/config';
export const initPostHog = () => {
if (typeof window !== 'undefined') {
// eslint-disable-next-line
if (ENV == 'production' && TELEMETRY_CAPTURING_ENABLED) {
posthog.init(POSTHOG_API_KEY, {
api_host: POSTHOG_HOST
});
}
}
return posthog;
};
@@ -10,7 +10,7 @@ class Capturer {
capture(item) {
if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) {
try {
api.capture(item);
this.api.capture(item);
} catch (error) {
console.error("PostHog", error);
}
@@ -20,7 +20,7 @@ class Capturer {
identify(id) {
if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) {
try {
api.identify(id);
this.api.identify(id);
} catch (error) {
console.error("PostHog", error);
}