feat: conditionally track app launch, exit, and failure events based on trackingEnabled state

This commit is contained in:
HorizonCode committed 2025-12-07 16:21:21 +01:00
1 parent a338df6a36
commit b8ebcf5509
1 file changed
+3 -3
+3 -3
View File
@@ -181,7 +181,7 @@
}; };
const launch = async () => { const launch = async () => {
umami.track('app_launch_osu'); if ($trackingEnabled) umami.track('app_launch_osu');
const osuRunning = await isOsuRunning(); const osuRunning = await isOsuRunning();
if (osuRunning) { if (osuRunning) {
toast.error('Hold on a second!', { toast.error('Hold on a second!', {
@@ -485,7 +485,7 @@
} }
await runOsu(osuPath, true); await runOsu(osuPath, true);
umami.track('app_exit_osu'); if ($trackingEnabled) umami.track('app_exit_osu');
launchInfo = 'Cleaning up...'; launchInfo = 'Cleaning up...';
await getCurrentWindow().show(); await getCurrentWindow().show();
if (presenceUpdater) { if (presenceUpdater) {
@@ -536,7 +536,7 @@
description: 'Failed to launch.', description: 'Failed to launch.',
}); });
launching.set(false); launching.set(false);
umami.track('app_launch_fail', { error: err }); if ($trackingEnabled) umami.track('app_launch_fail', { error: err });
} }
}; };