Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"client-zip": "catalog:",
"fflate": "catalog:",
"pinia": "catalog:",
"swetrix": "catalog:",
"vue": "catalog:"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions apps/playground/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const createApp = ViteSSG(
pinia.state.value = initialState.pinia || {}

if (!import.meta.env.SSR) {
await import('./plugins/analytics')
const { useAuthStore } = await import('@vuetify/auth')
useAuthStore().verify()
}
Expand Down
20 changes: 20 additions & 0 deletions apps/playground/src/plugins/analytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Framework
import { IN_BROWSER } from '@vuetify/v0/constants'

async function initAnalytics () {
const Swetrix = await import('swetrix')
Swetrix.init('NYQnHCV4oCFA', {
apiURL: 'https://swetrix-api.vuetifyjs.com/log',
})
Swetrix.trackViews()
Swetrix.trackErrors()
}

if (IN_BROWSER) {
const timeout = 2000
if (typeof requestIdleCallback === 'function') {
requestIdleCallback(() => initAnalytics(), { timeout })
} else {
setTimeout(initAnalytics, timeout)
}
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading