Fix: Change add_group to people.set for workspaces (#2999)

This commit is contained in:
Mike
2024-09-16 14:34:30 +02:00
committed by GitHub
parent b58d077cf3
commit 2fb25d1379
4 changed files with 16 additions and 6 deletions
@@ -203,9 +203,13 @@ const mixpanel = useMixpanel()
const isOpenMobile = ref(false)
const showWorkspaceCreateDialog = ref(false)
const { result: workspaceResult } = useQuery(settingsSidebarQuery, null, {
enabled: isWorkspacesEnabled.value
})
const { result: workspaceResult, onResult: onWorkspaceResult } = useQuery(
settingsSidebarQuery,
null,
{
enabled: isWorkspacesEnabled.value
}
)
const isActive = (...routes: string[]): boolean => {
return routes.some((routeTo) => route.path === routeTo)
@@ -233,4 +237,13 @@ const openWorkspaceCreateDialog = () => {
source: 'sidebar'
})
}
onWorkspaceResult((result) => {
if (result.data?.activeUser) {
const workspaceIds = result.data.activeUser.workspaces.items.map(
(workspace) => workspace.id
)
mixpanel.people.set('workspace_id', workspaceIds)
}
})
</script>
@@ -171,7 +171,6 @@ const onAcceptClick = (token?: string) => {
// eslint-disable-next-line camelcase
workspace_id: props.invite.workspace.id
})
mixpanel.add_group('workspace_id', props.invite.workspace.id)
}
}
</script>
@@ -129,7 +129,6 @@ const processJoin = async (accept: boolean) => {
// eslint-disable-next-line camelcase
workspace_id: props.workspace.id
})
mixpanel.add_group('workspace_id', props.workspace.id)
router.push(`/workspaces/${props.workspace.id}`)
} else {
@@ -196,7 +196,6 @@ export const useProcessWorkspaceInvite = () => {
// eslint-disable-next-line camelcase
workspace_id: workspaceId
})
mp.add_group('workspace_id', workspaceId)
} else {
const err = getFirstErrorMessage(errors)
const preventErrorToasts = isFunction(options?.preventErrorToasts)