Fix: Invite banner mixpanel event (#3704)
This commit is contained in:
@@ -149,7 +149,6 @@ const onDeclineClick = (token?: string) => {
|
||||
mixpanel.track('Invite Action', {
|
||||
accepted: false,
|
||||
type: 'workspace invite',
|
||||
location: 'invite banner',
|
||||
// eslint-disable-next-line camelcase
|
||||
workspace_id: props.invite.workspace.id
|
||||
})
|
||||
@@ -159,12 +158,6 @@ const onDeclineClick = (token?: string) => {
|
||||
const onAcceptClick = (token?: string) => {
|
||||
emit('processed', true, token)
|
||||
if (props.invite.workspace) {
|
||||
mixpanel.track('Workspace Joined', {
|
||||
location: 'invite banner',
|
||||
// eslint-disable-next-line camelcase
|
||||
workspace_id: props.invite.workspace.id
|
||||
})
|
||||
|
||||
mixpanel.track('Invite Action', {
|
||||
accepted: true,
|
||||
type: 'workspace invite',
|
||||
|
||||
@@ -16,6 +16,7 @@ import type { Optional } from '@speckle/shared'
|
||||
import type { WorkspaceInviteBanner_PendingWorkspaceCollaboratorFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import { useWorkspaceInviteManager } from '~/lib/workspaces/composables/management'
|
||||
import { graphql } from '~~/lib/common/generated/gql'
|
||||
import { useMixpanel } from '~~/lib/core/composables/mp'
|
||||
|
||||
graphql(`
|
||||
fragment WorkspaceInviteBanner_PendingWorkspaceCollaborator on PendingWorkspaceCollaborator {
|
||||
@@ -51,11 +52,19 @@ const { loading, accept, decline } = useWorkspaceInviteManager(
|
||||
}
|
||||
)
|
||||
|
||||
const mixpanel = useMixpanel()
|
||||
|
||||
const processInvite = async (shouldAccept: boolean, token: Optional<string>) => {
|
||||
if (!token) return
|
||||
|
||||
if (shouldAccept) {
|
||||
await accept()
|
||||
|
||||
mixpanel.track('Workspace Joined', {
|
||||
location: 'invite banner',
|
||||
// eslint-disable-next-line camelcase
|
||||
workspace_id: props.invite.workspaceId
|
||||
})
|
||||
} else {
|
||||
await decline()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user