Skip to content

Commit 895c2dd

Browse files
committed
refactor(stage-ui): remove versionMeta
1 parent 59e1281 commit 895c2dd

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

  • packages/stage-ui/src/stores/analytics

packages/stage-ui/src/stores/analytics/index.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { AboutBuildInfo } from '../../components/scenarios/about/types'
33
import posthog from 'posthog-js'
44

55
import { defineStore } from 'pinia'
6-
import { computed, ref } from 'vue'
6+
import { ref } from 'vue'
77

88
export const useSharedAnalyticsStore = defineStore('shared_analytics', () => {
99
const isInitialized = ref(false)
@@ -16,13 +16,6 @@ export const useSharedAnalyticsStore = defineStore('shared_analytics', () => {
1616
const appStartTime = ref<number | null>(null)
1717
const firstMessageTracked = ref(false)
1818

19-
const versionMeta = computed(() => ({
20-
app_version: (buildInfo.value.version && buildInfo.value.version !== '0.0.0') ? buildInfo.value.version : 'dev',
21-
app_commit: buildInfo.value.commit,
22-
app_branch: buildInfo.value.branch,
23-
app_build_time: buildInfo.value.builtOn,
24-
}))
25-
2619
function initialize(info: AboutBuildInfo) {
2720
if (isInitialized.value)
2821
return
@@ -31,7 +24,12 @@ export const useSharedAnalyticsStore = defineStore('shared_analytics', () => {
3124
appStartTime.value = Date.now()
3225

3326
// Register metadata with PostHog after buildInfo is set
34-
posthog.register(versionMeta.value)
27+
posthog.register({
28+
app_version: (buildInfo.value.version && buildInfo.value.version !== '0.0.0') ? buildInfo.value.version : 'dev',
29+
app_commit: buildInfo.value.commit,
30+
app_branch: buildInfo.value.branch,
31+
app_build_time: buildInfo.value.builtOn,
32+
})
3533

3634
isInitialized.value = true
3735
}
@@ -42,7 +40,6 @@ export const useSharedAnalyticsStore = defineStore('shared_analytics', () => {
4240

4341
return {
4442
buildInfo,
45-
versionMeta,
4643
appStartTime,
4744
firstMessageTracked,
4845
initialize,

0 commit comments

Comments
 (0)