diff --git a/src/analytics.ts b/src/analytics.ts index 3284928..ace50f9 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -1,3 +1,4 @@ +import { AppConfig } from './config'; import { AppConsole } from './ui/console'; const gtag = require('ga-gtag'); @@ -15,14 +16,16 @@ export class AppAnalytics { public static Init() { gtag.install('G-W0SCWQ7HGJ', { 'send_page_view': true }); - gtag.gtag('config', 'G-W0SCWQ7HGJ', { 'debug_mode': true }); + if (AppConfig.Get.VERSION_TYPE === 'd') { + gtag.gtag('config', 'G-W0SCWQ7HGJ', { 'debug_mode': true }); + } this.Get._ready = true; } public static Event(id: string, attributes?: any) { if (this.Get._ready) { console.log('[Analytics]: Tracked event', id, attributes); - gtag.gtag('event', id, Object.assign(attributes ?? {}, { 'debug_mode': true })); + gtag.gtag('event', id, Object.assign(attributes ?? {}, AppConfig.Get.VERSION_TYPE === 'd' ? { 'debug_mode': true } : {})); } } } \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index 019b85a..aa98424 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,11 +8,11 @@ export class AppConfig { return this._instance || (this._instance = new this()); } - public readonly RELEASE_MODE = true; + public readonly RELEASE_MODE; public readonly MAJOR_VERSION = 0; public readonly MINOR_VERSION = 8; - public readonly HOTFIX_VERSION = 5; - public readonly VERSION_TYPE: 'd' | 'a' | 'r' = 'r'; // dev, alpha, or release build + public readonly HOTFIX_VERSION = 6; + public readonly VERSION_TYPE: 'd' | 'a' | 'r' = 'd'; // dev, alpha, or release build public readonly MINECRAFT_VERSION = '1.19.4'; public readonly LOCALE = 'en_GB'; @@ -43,6 +43,7 @@ export class AppConfig { public readonly FRESNEL_MIX = 0.3; private constructor() { + this.RELEASE_MODE = this.VERSION_TYPE === 'r'; } public dumpConfig() {