Skip to content

Commit 274bbfa

Browse files
committed
Track first runs by OS
1 parent 981598d commit 274bbfa

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ reportStartupEvents();
218218
if (require('electron-squirrel-startup')) {
219219
// We've been opened as part of a Windows install.
220220
// squirrel-startup handles all the hard work, we just need to not do anything.
221-
app.quit();
221+
222+
// Brief delay before quitting, so our analytics register
223+
setTimeout(() => app.quit(), 500);
222224
} else {
223225
startServer().catch((err) => {
224226
reportError(err);

src/report-install-event.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export function reportStartupEvents() {
1515

1616
// Report installer install/update/uninstall events
1717
if (cmd === '--squirrel-install') {
18-
analytics.event("Setup", "Install").send();
18+
analytics.event('Setup', 'Install').send();
1919
} else if (cmd === '--squirrel-updated') {
20-
analytics.event("Setup", "Update").send();
20+
analytics.event('Setup', 'Update').send();
2121
} else if (cmd === '--squirrel-uninstall') {
22-
analytics.event("Setup", "Uninstall").send();
22+
analytics.event('Setup', 'Uninstall').send();
2323
}
2424
}
2525

2626
if (isFirstRun()) {
27-
analytics.event("Setup", "First run").send();
27+
analytics.event('Setup', 'First run', process.platform).send();
2828
}
2929
}

0 commit comments

Comments
 (0)