aboutsummaryrefslogtreecommitdiff
path: root/src/routes/+layout.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/+layout.svelte')
-rw-r--r--src/routes/+layout.svelte5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index b1f9fc87..a35fee29 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -32,6 +32,7 @@ import Message from "$lib/Loading/Message.svelte";
import { requestNotifications } from "$lib/Utility/notifications";
import { database as userDatabase } from "$lib/Database/IDB/user";
import CommandPalette from "$lib/CommandPalette/CommandPalette.svelte";
+import { track } from "$lib/analytics";
import { defaultActions } from "$lib/CommandPalette/actions";
import { authActions } from "$lib/CommandPalette/authActions";
import { syncActions } from "$lib/CommandPalette/syncActions";
@@ -402,6 +403,8 @@ $: {
url: '#',
preventDefault: true,
onClick: async () => {
+ track('Log Out', { source: 'header' });
+
await localforage.removeItem('identity');
await localforage.removeItem('commit');
@@ -424,6 +427,8 @@ $: {
class="header-item"
href={`https://anilist.co/api/v2/oauth/authorize?client_id=${env.PUBLIC_ANILIST_CLIENT_ID}&redirect_uri=${env.PUBLIC_ANILIST_REDIRECT_URI}&response_type=code`}
onclick={async () => {
+ track('Log In', { source: 'header' });
+
await localforage.setItem(
'redirect',
window.location.origin + window.location.pathname + window.location.search