feat: add umami tracking for app launch and exit events; update dependencies in package.json and bun.lock
This commit is contained in:
1 parent
3d57524a16
commit
ad090ce38c
6 files changed
+35
-16
No files matched your search
+12
-10
@@ -1,13 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>EZPPLauncher</title>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
|
||||
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>EZPPLauncher</title>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
|
||||
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -9,7 +9,7 @@ export function estimateRefreshRate(): Promise<number> {
|
||||
|
||||
if (now - last >= 1000) {
|
||||
console.log(`Estimated Refresh Rate: ${frames - 2} FPS`);
|
||||
resolve(frames - 2); // estimated Hz
|
||||
resolve(frames - 2);
|
||||
} else {
|
||||
requestAnimationFrame(loop);
|
||||
}
|
||||
|
||||
+12
-1
@@ -1,10 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { currentView } from '@/global';
|
||||
import { currentView, launcherVersion } from '@/global';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
const View = $derived($currentView);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{#if $launcherVersion !== ''}
|
||||
<script
|
||||
defer
|
||||
src="https://analytics.ez-pp.farm/script.js"
|
||||
data-website-id="b03f0013-64f0-42ce-85c0-abd56e8b3c64"
|
||||
data-tag={$launcherVersion}
|
||||
></script>
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
{#key View}
|
||||
<div in:fade={{ duration: 300 }}>
|
||||
<View />
|
||||
|
||||
@@ -177,6 +177,7 @@
|
||||
};
|
||||
|
||||
const launch = async () => {
|
||||
umami.track('app_launch_osu');
|
||||
const osuRunning = await isOsuRunning();
|
||||
if (osuRunning) {
|
||||
toast.error('Hold on a second!', {
|
||||
@@ -480,7 +481,7 @@
|
||||
}
|
||||
|
||||
await runOsu(osuPath, true);
|
||||
|
||||
umami.track('app_exit_osu');
|
||||
launchInfo = 'Cleaning up...';
|
||||
await getCurrentWindow().show();
|
||||
if (presenceUpdater) {
|
||||
@@ -531,6 +532,7 @@
|
||||
description: 'Failed to launch.',
|
||||
});
|
||||
launching.set(false);
|
||||
umami.track('app_launch_fail', { error: err });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1283,4 +1285,4 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user