Skip to content

Commit

Permalink
fix: added APP_QUIT telemetry event
Browse files Browse the repository at this point in the history
  • Loading branch information
olensmar committed Mar 30, 2023
1 parent f9b26d5 commit 6a1c9c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions electron/app/openApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ElectronStore from 'electron-store';
import log from 'loglevel';
import * as path from 'path';

import {trackEvent} from '@shared/utils';
import {logToFile} from '@shared/utils/logs';

import {createWindow} from './createWindow';
Expand Down Expand Up @@ -66,4 +67,8 @@ export const openApplication = async (givenPath?: string) => {
globalShortcut.unregister('CommandOrControl+R');
globalShortcut.unregister('CommandOrControl+Shift+R');
});

app.on('quit', (event, exitCode) => {
trackEvent('APP_QUIT', {exitCode});
});
};
2 changes: 2 additions & 0 deletions src/shared/models/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type EventMap = {
APP_SESSION: {appVersion: string};
APP_UPDATED: {oldVersion: string; newVersion: string};
APP_DOWNGRADED: {oldVersion: string; newVersion: string};
APP_QUIT: {exitCode: number};
'app_start/open_project': {numberOfFiles: number; numberOfResources: number; executionTime: number};
'app_start/create_project': {from: 'scratch' | 'git' | 'template'; templateID?: string};
'app_start/quick_cluster_preview': undefined;
Expand Down Expand Up @@ -89,3 +90,4 @@ export const APP_SESSION = 'APP_SESSION';
export const APP_UPDATED = 'APP_UPDATED';
export const APP_DOWNGRADED = 'APP_DOWNGRADED';
export const DISABLED_TELEMETRY = 'DISABLED_TELEMETRY';
export const APP_QUIT = 'APP_QUIT';

0 comments on commit 6a1c9c8

Please sign in to comment.