Skip to content

Commit 25d87b1

Browse files
committed
feat: leaderboard analytics
1 parent 08240f5 commit 25d87b1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/app/pages/standings.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<script setup lang="ts">
2+
const { track } = useAnalytics()
3+
24
const params = useUrlSearchParams('history')
35
const tab = computed({
46
get() {
57
if (typeof params.tab === 'string') return params.tab
68
return 'global'
79
},
8-
set(tab: 'global' | 'unit' | 'local') {
9-
params.tab = tab
10+
set(newTab: 'global' | 'unit' | 'local') {
11+
const oldTab = tab.value
12+
track(AnalyticsEvent.LeaderboardTabChanged, { from: oldTab, to: newTab })
13+
params.tab = newTab
1014
},
1115
})
1216
</script>

0 commit comments

Comments
 (0)