Skip to content

Commit c3c44c5

Browse files
committed
add main window closed event
1 parent e7f8bdd commit c3c44c5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/backend/metrics/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,12 @@ export interface AccountDropdownPortfolioClicked {
424424
sensitiveProperties?: never
425425
}
426426

427+
export interface MainWindowClosed {
428+
event: 'Main Window Closed'
429+
properties?: never
430+
sensitiveProperties?: never
431+
}
432+
427433
export type PossibleMetricPayloads =
428434
| MetricsOptIn
429435
| MetricsOptOut
@@ -467,5 +473,6 @@ export type PossibleMetricPayloads =
467473
| PatchingFailed
468474
| PatchingTooSlow
469475
| AccountDropdownPortfolioClicked
476+
| MainWindowClosed
470477

471478
export type PossibleMetricEventNames = PossibleMetricPayloads['event']

src/backend/utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import {
8282
} from './utils/systeminfo/gpu/pci_ids'
8383
import { copyFile, lstat, mkdir, readdir } from 'fs/promises'
8484
import { GameConfig } from './game_config'
85+
import { trackEvent } from './metrics/metrics'
8586

8687
const execAsync = promisify(exec)
8788

@@ -260,6 +261,7 @@ async function handleExit() {
260261
// Kill all child processes
261262
callAllAbortControllers()
262263
}
264+
trackEvent({ event: 'Main Window Closed' })
263265
app.exit()
264266
}
265267

0 commit comments

Comments
 (0)