Skip to content

Commit

Permalink
🔨 Only call metrix if posthog is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount committed Aug 1, 2024
1 parent 39c8dcb commit 198ef91
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,16 @@ provide(refreshKey, getDbData);
onMounted(async () => {
const usePosthog = inject(usePosthogKey);
const id = await onPageLoad();
if (usePosthog && isAuthenticated.value) {
const profile = useUserStore();
posthog.identify(profile.data.uniqueHash);
} else if (usePosthog && id) {
posthog.identify(id);
if (usePosthog) {
const id = await onPageLoad();
if (isAuthenticated.value) {
const profile = useUserStore();
posthog.identify(profile.data.uniqueHash);
} else if (id) {
posthog.identify(id);
}
}
});
Expand Down

0 comments on commit 198ef91

Please sign in to comment.