chore: check analytics issue [INS-4212] (#7775)

This commit is contained in:
Filipe Freire 2024-07-29 16:32:00 +01:00 committed by GitHub
parent cf70af683a
commit 9a28eb3268
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
export enum SegmentEvent {
appStarted = 'App Started',
analyticsDisabled = 'Analytics Disabled',
collectionCreate = 'Collection Created',
dataExport = 'Data Exported',
dataImport = 'Data Imported',

View File

@ -1269,6 +1269,9 @@ export const deleteClientCertificateAction: ActionFunction = async ({ request })
export const updateSettingsAction: ActionFunction = async ({ request }) => {
const patch = await request.json();
if (patch.hasOwnProperty('enableAnalytics') && !patch.enableAnalytics) {
window.main.trackSegmentEvent({ event: SegmentEvent.analyticsDisabled });
}
await models.settings.patch(patch);
return null;
};