Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from MozillaSocial/feat/enable-glean-in-produc…
Browse files Browse the repository at this point in the history
…tion

feat(glean): enable glean in prod - SOCWEB-145
  • Loading branch information
wtfluckey authored Nov 29, 2023
2 parents 2b1db2d + 90ef3ca commit 182aec7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 8 additions & 8 deletions modules/glean/runtime/glean-plugin.client.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import Glean from '@mozilla/glean/web'
import * as log from 'tauri-plugin-log-api'

import { linkClick, pageUrl, pageView, referrerUrl } from '../../../telemetry/generated/web'
import { userAgent } from '../../../telemetry/generated/identifiers'
import { engagement } from '../../../telemetry/generated/ui'
import { engagementDetails } from '../../../telemetry/engagementDetails'
import { userAgent } from '~~/telemetry/generated/identifiers'
import { engagement } from '~~/telemetry/generated/ui'
import { linkClick, pageUrl, pageView, referrerUrl } from '~~/telemetry/generated/web'
import { engagementDetails } from '~~/telemetry/engagementDetails'

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('app:mounted', () => {
log.info('Glean: App mounted, start initing glean')

const GLEAN_APP_ID = 'moso-mastodon-web'
const env = useAppConfig().env
const devMode = env === ('dev' || 'canary' || 'preview')
const env = useBuildInfo().env
const devMode = env === 'dev'
const userSettings = useUserSettings()
const allowGlean = getPreferences(userSettings.value, 'allowGlean')
const uploadEnabled = devMode && allowGlean
const userAllowGlean = getPreferences(userSettings.value, 'allowGlean')
const uploadEnabled = userAllowGlean

Glean.initialize(GLEAN_APP_ID, uploadEnabled, { channel: env })
userAgent.set(navigator.userAgent)
Expand Down
2 changes: 0 additions & 2 deletions pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ useHydratedHead({
const route = useRoute()
const isRootPath = computedEager(() => route.name === 'settings')
const devMode = useAppConfig().env === ('dev' || 'canary' || 'preview')
</script>

<template>
Expand Down Expand Up @@ -65,7 +64,6 @@ const devMode = useAppConfig().env === ('dev' || 'canary' || 'preview')
:match="$route.path.startsWith('/settings/preferences/')"
/>
<SettingsItem
v-if="devMode"
command
icon="i-ri-lock-line"
:text="isHydrated ? $t('settings.privacy.label') : ''"
Expand Down

0 comments on commit 182aec7

Please sign in to comment.