chore: telemetry fixes
This commit is contained in:
Submodule frappe-ui updated: 175be05a92...fd5252663b
@@ -9,16 +9,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { FrappeUIProvider } from 'frappe-ui'
|
import { FrappeUIProvider } from 'frappe-ui'
|
||||||
import { Dialogs } from '@/utils/dialogs'
|
import { Dialogs } from '@/utils/dialogs'
|
||||||
import { computed, onUnmounted, ref } from 'vue'
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||||
import { useScreenSize } from './utils/composables'
|
import { useScreenSize } from './utils/composables'
|
||||||
import DesktopLayout from './components/DesktopLayout.vue'
|
import DesktopLayout from './components/DesktopLayout.vue'
|
||||||
import MobileLayout from './components/MobileLayout.vue'
|
import MobileLayout from './components/MobileLayout.vue'
|
||||||
import NoSidebarLayout from './components/NoSidebarLayout.vue'
|
import NoSidebarLayout from './components/NoSidebarLayout.vue'
|
||||||
|
import { usersStore } from '@/stores/user'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { posthogSettings } from '@/telemetry'
|
||||||
|
|
||||||
const screenSize = useScreenSize()
|
const screenSize = useScreenSize()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const noSidebar = ref(false)
|
const noSidebar = ref(false)
|
||||||
|
const { userResource } = usersStore()
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.query.fromLesson || to.path === '/persona') {
|
if (to.query.fromLesson || to.path === '/persona') {
|
||||||
@@ -44,4 +47,10 @@ onUnmounted(() => {
|
|||||||
noSidebar.value = false
|
noSidebar.value = false
|
||||||
stopSession()
|
stopSession()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(userResource, () => {
|
||||||
|
if (userResource.data) {
|
||||||
|
posthogSettings.reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ declare global {
|
|||||||
posthog: any
|
posthog: any
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type PosthogSettings = {
|
type PosthogSettings = {
|
||||||
posthog_project_id: string
|
posthog_project_id: string
|
||||||
posthog_host: string
|
posthog_host: string
|
||||||
enable_telemetry: boolean
|
enable_telemetry: boolean
|
||||||
telemetry_site_age: number
|
telemetry_site_age: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CaptureOptions {
|
interface CaptureOptions {
|
||||||
data: {
|
data: {
|
||||||
user: string
|
user: string
|
||||||
|
|||||||
Reference in New Issue
Block a user