FIX: updated posthog client version and fixed a bug with its toolbar

This commit is contained in:
Kharhamel 2021-10-08 11:53:45 +02:00
parent 60eefbce94
commit 59fa68e063
3 changed files with 9 additions and 5 deletions

View File

@ -50,7 +50,7 @@
"phaser": "^3.54.0", "phaser": "^3.54.0",
"phaser-animated-tiles": "workadventure/phaser-animated-tiles#da68bbededd605925621dd4f03bd27e69284b254", "phaser-animated-tiles": "workadventure/phaser-animated-tiles#da68bbededd605925621dd4f03bd27e69284b254",
"phaser3-rex-plugins": "^1.1.42", "phaser3-rex-plugins": "^1.1.42",
"posthog-js": "^1.13.12", "posthog-js": "^1.14.1",
"queue-typescript": "^1.0.1", "queue-typescript": "^1.0.1",
"quill": "1.3.6", "quill": "1.3.6",
"quill-delta-to-html": "^0.12.0", "quill-delta-to-html": "^0.12.0",

View File

@ -1,4 +1,6 @@
import { POSTHOG_API_KEY, POSTHOG_URL } from "../Enum/EnvironmentVariable"; import { POSTHOG_API_KEY, POSTHOG_URL } from "../Enum/EnvironmentVariable";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare let window: any;
class AnalyticsClient { class AnalyticsClient {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -8,6 +10,8 @@ class AnalyticsClient {
if (POSTHOG_API_KEY && POSTHOG_URL) { if (POSTHOG_API_KEY && POSTHOG_URL) {
this.posthogPromise = import("posthog-js").then(({ default: posthog }) => { this.posthogPromise = import("posthog-js").then(({ default: posthog }) => {
posthog.init(POSTHOG_API_KEY, { api_host: POSTHOG_URL, disable_cookie: true }); posthog.init(POSTHOG_API_KEY, { api_host: POSTHOG_URL, disable_cookie: true });
//the posthog toolbar need a reference in window to be able to work
window.posthog = posthog;
return posthog; return posthog;
}); });
} else { } else {

View File

@ -4494,10 +4494,10 @@ postcss@^8.2.10:
nanoid "^3.1.23" nanoid "^3.1.23"
source-map "^0.6.1" source-map "^0.6.1"
posthog-js@^1.13.12: posthog-js@^1.14.1:
version "1.13.12" version "1.14.1"
resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.13.12.tgz#b54efcb92de43724c889048135ccaae3dc4b874c" resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.14.1.tgz#68553b9074c686784b994b3f433ad035b241deaa"
integrity sha512-MU1I0zSVhdCcnWI8jAZLtbNJmjfg9AnhUDq5dUzNkb0qPXtNz17BekalnNwDMKs0Zlek3UCOVsIpyc85M+VRNA== integrity sha512-gVFk6fsTxG9T+5oqZghffYovENSrs05v3hQMiRQENtGlsHGpt1fnoQ52En8Vg5brMxqLv1XZO4lMgm12/ubH0Q==
dependencies: dependencies:
"@sentry/types" "^6.11.0" "@sentry/types" "^6.11.0"
fflate "^0.4.1" fflate "^0.4.1"