mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-28 04:47:42 +03:00
Fix posthog events
- broken due register call coming before init
This commit is contained in:
parent
2f1cc069be
commit
b4d56e191f
@ -5,10 +5,6 @@ import { getVersion, getName } from '@tauri-apps/api/app';
|
||||
|
||||
export async function initPostHog() {
|
||||
const [appName, appVersion] = await Promise.all([getName(), getVersion()]);
|
||||
posthog.register_for_session({
|
||||
appName,
|
||||
appVersion
|
||||
});
|
||||
posthog.init(PUBLIC_POSTHOG_API_KEY, {
|
||||
api_host: 'https://eu.posthog.com',
|
||||
disable_session_recording: appName !== 'GitButler', // only record sessions in production
|
||||
@ -19,6 +15,10 @@ export async function initPostHog() {
|
||||
console.log('posthog error', e);
|
||||
}
|
||||
});
|
||||
posthog.register({
|
||||
appName,
|
||||
appVersion
|
||||
});
|
||||
}
|
||||
|
||||
export function setPostHogUser(user: User) {
|
||||
|
Loading…
Reference in New Issue
Block a user