From 44c35df10de3884e865ec2d6b1ab568f0694ec1f Mon Sep 17 00:00:00 2001 From: f1ames Date: Tue, 2 Jan 2024 15:47:41 +0100 Subject: [PATCH] fix: send machineId only when tracking enabled --- electron/app/services/cloud/client-config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/electron/app/services/cloud/client-config.ts b/electron/app/services/cloud/client-config.ts index 7170b6ba3..73a7b06cb 100644 --- a/electron/app/services/cloud/client-config.ts +++ b/electron/app/services/cloud/client-config.ts @@ -1,16 +1,18 @@ import {type, release} from 'os'; import {machineIdSync} from 'node-machine-id'; import {app} from 'electron'; +import electronStore from '@shared/utils/electronStore'; const CLIENT_NAME = 'Monokle Desktop'; export function getClientConfig() { + const isTrackingDisabled = Boolean(electronStore.get('appConfig.disableEventTracking')); + const additionalData = isTrackingDisabled ? undefined : { machineId: machineIdSync() }; + return { name: CLIENT_NAME, version: app.getVersion(), os: `${type()} ${release()}`, - additionalData: { - machineId: machineIdSync(), - } + additionalData, }; }