File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11import { ReactElement , useEffect , useState } from "react" ;
2- import { PostHogProvider } from "posthog-js/react"
2+ import { PostHogProvider , usePostHog } from "posthog-js/react"
33import { invoke } from "@tauri-apps/api/core" ;
4+ import { app } from "@tauri-apps/api" ;
5+
46
57const posthogKey = import . meta. env . PUBLIC_POSTHOG_KEY ;
68const posthogHost = import . meta. env . PUBLIC_POSTHOG_HOST ;
79
810export default function PosthogProvider ( { children } : { children : ReactElement } ) {
911
1012 const [ isOkSharingUsageData , setIsOkSharingUsageData ] = useState ( true ) ;
13+ const posthog = usePostHog ( ) ;
14+
15+ useEffect ( ( ) => {
16+ app . getVersion ( ) . then ( version => {
17+ posthog . register ( {
18+ 'App Version' : version
19+ } )
20+ } )
21+ } , [ ] )
1122
1223 useEffect ( ( ) => {
1324 invoke ( 'is_ok_sharing_usage_data' ) . then ( ( res ) => {
You can’t perform that action at this time.
0 commit comments