diff --git a/front/src/Administration/AnalyticsClient.ts b/front/src/Administration/AnalyticsClient.ts index f3cde793..f73a1981 100644 --- a/front/src/Administration/AnalyticsClient.ts +++ b/front/src/Administration/AnalyticsClient.ts @@ -1,13 +1,12 @@ -import {POSTHOG_API_KEY, POSTHOG_URL} from "../Enum/EnvironmentVariable"; +import { POSTHOG_API_KEY, POSTHOG_URL } from "../Enum/EnvironmentVariable"; class AnalyticsClient { - // eslint-disable-next-line @typescript-eslint/no-explicit-any private posthogPromise: Promise; constructor() { 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 }); return posthog; }); @@ -17,45 +16,59 @@ class AnalyticsClient { } identifyUser(uuid: string) { - this.posthogPromise.then(posthog => { - posthog.identify(uuid, { uuid, wa: true }); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.identify(uuid, { uuid, wa: true }); + }) + .catch(); } loggedWithSso() { - this.posthogPromise.then(posthog => { - posthog.capture('wa-logged-sso'); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("wa-logged-sso"); + }) + .catch(); } loggedWithToken() { - this.posthogPromise.then(posthog => { - posthog.capture('wa-logged-token'); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("wa-logged-token"); + }) + .catch(); } enteredRoom(roomId: string) { - this.posthogPromise.then(posthog => { - posthog.capture('$pageView', {roomId}); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("$pageView", { roomId }); + }) + .catch(); } openedMenu() { - this.posthogPromise.then(posthog => { - posthog.capture('wa-opened-menu'); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("wa-opened-menu"); + }) + .catch(); } launchEmote(emote: string) { - this.posthogPromise.then(posthog => { - posthog.capture('wa-emote-launch', {emote}); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("wa-emote-launch", { emote }); + }) + .catch(); } enteredJitsi(roomName: string, roomId: string) { - this.posthogPromise.then(posthog => { - posthog.capture('wa-entered-jitsi', {roomName, roomId}); - }).catch(); + this.posthogPromise + .then((posthog) => { + posthog.capture("wa-entered-jitsi", { roomName, roomId }); + }) + .catch(); } } export const analyticsClient = new AnalyticsClient(); diff --git a/front/src/Components/EmoteMenu/EmoteMenu.svelte b/front/src/Components/EmoteMenu/EmoteMenu.svelte index 9a866631..7ba896d9 100644 --- a/front/src/Components/EmoteMenu/EmoteMenu.svelte +++ b/front/src/Components/EmoteMenu/EmoteMenu.svelte @@ -68,9 +68,9 @@ height: 100%; justify-content: center; align-items: center; + } - .emote-menu { - pointer-events: all; - } + .emote-menu { + pointer-events: all; } \ No newline at end of file diff --git a/front/src/Connexion/EmoteEventStream.ts b/front/src/Connexion/EmoteEventStream.ts index ddf21ba1..32f1daa0 100644 --- a/front/src/Connexion/EmoteEventStream.ts +++ b/front/src/Connexion/EmoteEventStream.ts @@ -9,7 +9,6 @@ class EmoteEventStream { private _stream: Subject = new Subject(); public stream = this._stream.asObservable(); - fire(userId: number, emote: string) { this._stream.next({ userId, emote }); } diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index e724599c..c0c19f1c 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -20,7 +20,7 @@ export const DISPLAY_TERMS_OF_USE = process.env.DISPLAY_TERMS_OF_USE == "true"; export const NODE_ENV = process.env.NODE_ENV || "development"; export const CONTACT_URL = process.env.CONTACT_URL || undefined; export const PROFILE_URL = process.env.PROFILE_URL || undefined; -export const POSTHOG_API_KEY: string = process.env.POSTHOG_API_KEY as string || ''; +export const POSTHOG_API_KEY: string = (process.env.POSTHOG_API_KEY as string) || ""; export const POSTHOG_URL = process.env.POSTHOG_URL || undefined; export const isMobile = (): boolean => window.innerWidth <= 800 || window.innerHeight <= 600; diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index b0433b39..f87a6a67 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -300,20 +300,18 @@ export abstract class Character extends Container { } private createStartTransition(emoteY: number) { - if (this.emote) { - this.emoteTween = this.scene?.tweens.add({ - targets: this.emote, - props: { - alpha: 1, - y: emoteY, - }, - ease: "Power2", - duration: 500, - onComplete: () => { - this.startPulseTransition(emoteY); - }, - }); - } + this.emoteTween = this.scene?.tweens.add({ + targets: this.emote, + props: { + alpha: 1, + y: emoteY, + }, + ease: "Power2", + duration: 500, + onComplete: () => { + this.startPulseTransition(emoteY); + }, + }); } private startPulseTransition(emoteY: number) { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 619ad9ed..acbfb5d5 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -644,9 +644,9 @@ export class GameScene extends DirtyScene { } else { this.userInputManager.restoreControls(); } - }) + }); - Promise.all([ this.connectionAnswerPromise as Promise, ...scriptPromises ]).then(() => { + Promise.all([this.connectionAnswerPromise as Promise, ...scriptPromises]).then(() => { this.scene.wake(); }); } @@ -1511,7 +1511,7 @@ export class GameScene extends DirtyScene { } else { emoteMenuStore.openEmoteMenu(); } - }) + }); this.CurrentPlayer.on(requestEmoteEventName, (emoteKey: string) => { this.connection?.emitEmoteEvent(emoteKey); analyticsClient.launchEmote(emoteKey); diff --git a/front/src/Phaser/Player/Player.ts b/front/src/Phaser/Player/Player.ts index 0bb104ee..3edcdcde 100644 --- a/front/src/Phaser/Player/Player.ts +++ b/front/src/Phaser/Player/Player.ts @@ -84,5 +84,4 @@ export class Player extends Character { public isMoving(): boolean { return this.wasMoving; } - } diff --git a/front/src/Stores/MenuStore.ts b/front/src/Stores/MenuStore.ts index e51a14c1..90dcf6a6 100644 --- a/front/src/Stores/MenuStore.ts +++ b/front/src/Stores/MenuStore.ts @@ -2,13 +2,13 @@ import { get, writable } from "svelte/store"; import Timeout = NodeJS.Timeout; import { userIsAdminStore } from "./GameStore"; import { CONTACT_URL } from "../Enum/EnvironmentVariable"; -import {analyticsClient} from "../Administration/AnalyticsClient"; +import { analyticsClient } from "../Administration/AnalyticsClient"; export const menuIconVisiblilityStore = writable(false); export const menuVisiblilityStore = writable(false); menuVisiblilityStore.subscribe((value) => { if (value) analyticsClient.openedMenu(); -}) +}); export const menuInputFocusStore = writable(false); export const userIsConnected = writable(false); diff --git a/front/src/index.ts b/front/src/index.ts index 9842e65d..7ef30340 100644 --- a/front/src/index.ts +++ b/front/src/index.ts @@ -23,7 +23,7 @@ import { Game } from "./Phaser/Game/Game"; import App from "./Components/App.svelte"; import { HtmlUtils } from "./WebRtc/HtmlUtils"; import WebGLRenderer = Phaser.Renderer.WebGL.WebGLRenderer; -import {analyticsClient} from "./Administration/AnalyticsClient"; +import { analyticsClient } from "./Administration/AnalyticsClient"; const { width, height } = coWebsiteManager.getGameSize(); const valueGameQuality = localUserStore.getGameQualityValue(); diff --git a/front/webpack.config.ts b/front/webpack.config.ts index c2c711fc..2446f2b1 100644 --- a/front/webpack.config.ts +++ b/front/webpack.config.ts @@ -7,7 +7,7 @@ import MiniCssExtractPlugin from "mini-css-extract-plugin"; import sveltePreprocess from "svelte-preprocess"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import NodePolyfillPlugin from "node-polyfill-webpack-plugin"; -import {POSTHOG_API_KEY, PROFILE_URL} from "./src/Enum/EnvironmentVariable"; +import { POSTHOG_API_KEY, PROFILE_URL } from "./src/Enum/EnvironmentVariable"; const mode = process.env.NODE_ENV ?? "development"; const buildNpmTypingsForApi = !!process.env.BUILD_TYPINGS;